Go Back   Computer Forums > Web Design | Website Development > Web Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 03-19-2013, 04:19 AM   #1
Solid State Member
 
Join Date: Mar 2013
Location: Mauritius
Posts: 9
Default return is not working

Hi everyone, I have a code to validate a form but the return function is not working. so here is a snippet of the code

<html>
<head>
<title>Satisfaction Form</title>
<script>
function Check()
{
var x=document.forms["satisfaction"] ["txtName"].value;

if (x==null || x=="")
{
alert("Field 'Your Name' should not be empty!");
return false;
}
}
</script>
</head>
<body>
<form name="satisfaction" action="satisfaction.php" method="post" onsubmit="Check()">
<table border=1>
<tr>
<td>Your Name</td>
<td><input type=text name="txtName" /></td>
</tr>
<tr>
<td align="center" colspan=2> <input type=submit name="submit" value="submit"/>
<input type=reset name="reset" value="reset"/></td>
</tr>
</table>
</form>
</body>
</html>

Anyone can find the error for me?
__________________

NiceBoy89 is offline   Reply With Quote
Old 03-19-2013, 07:34 AM   #2
Solid State Member
 
Join Date: Mar 2013
Location: Mauritius
Posts: 9
Default Re: return is not working

okay I found the mistake, on need to reply.
NiceBoy89 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 10:34 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0