Go to Post FIRST is like pizza--you and I might prefer different toppings, but there's no wrong way to do it. - Billfred [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 15-02-2014, 09:15
cmockjr's Avatar
cmockjr cmockjr is offline
Registered User
FRC #1741
 
Join Date: Feb 2014
Location: Indiana
Posts: 1
cmockjr is an unknown quantity at this point
A little help on some Javascript

Ok, I have been trying to make a php file cancel submitting the data the user enters when two pieces of information are the same using javascript. As far as I know, what I have tried should be working fine but the form keeps on submitting. Here is what I have:
javascript:
<script type="text/javascript">
function validateForm()
{
var Team1=document.getElementById("Team1").value;
var Team2=document.getElementById("Team2").value;
var Team3=document.getElementById("Team3").value;
if (Team1 != Team2) && (Team1 != Team3) && (Team2 != Team3)
{
return true;
} else {
alert('Choose 3 different Teams for the Match!');
return false;
}
}
</script>
HTML/PHP that is used to submit the match by activating another PHP file that submits the match to a database:
<input type="submit" value="Add/Update" style="margin: 0 auto" formaction="MatchTable.php" onsubmit="return validateForm();">
If anyone could help me on this, it would be really awesome.
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 08:45.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi