By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,630 Members | 1,252 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,630 IT Pros & Developers. It's quick & easy.

checking textfields

P: n/a
roN
Hi,
I'm getting desperate, I just wanna check if mandatory fields are filled
with text on http://paykiosks.net/contact_new.htm but it somehow just
wouldn't work. :(
s mall piece looks like:
[js]
if (document.Formular.first_name.value == "")
{
alert("Please enter your firstname!");
document.Formular.first_name.focus();
return false;
}
[/js]
[html]
<form name="Formular" method="post" onSubmit="return chkform()"
action="http://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8">
....
....
....
<input type="text" size="20" name="first_name" class="flat">
[/html]
What's wrong??? huh? can't see it...
I'd appreciate if anyone could have a look at it and tell me where i'm going
wrong. Thank you!

Ron
Sep 18 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a

roN wrote:
Hi,
I'm getting desperate, I just wanna check if mandatory fields are filled
with text on http://paykiosks.net/contact_new.htm but it somehow just
wouldn't work. :(
s mall piece looks like:
[js]
if (document.Formular.first_name.value == "")
{
alert("Please enter your firstname!");
document.Formular.first_name.focus();
return false;
}
[/js]
[html]
<form name="Formular" method="post" onSubmit="return chkform()"
action="http://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8">
...
...
...
<input type="text" size="20" name="first_name" class="flat">
[/html]
What's wrong??? huh? can't see it...
I'd appreciate if anyone could have a look at it and tell me where i'm going
wrong. Thank you!

Ron
I don't really see anything wrong. I created the following test page
based on your code and it worked as I expected. Copy and paste it and
see if you get the same results.

<html>
<head>
<script type="text/javascript">
function testIt() {
if (document.Formular.first_name.value == "")
{
alert("Please enter your firstname!");
document.Formular.first_name.focus();
return false;
}
}
</script>
</head>
<body>
<form name="Formular" onsubmit="return testIt();"
action="javascript:alert('Submitted');">
<input type="text" name="first_name"/><br/>
<input type="submit" value="Submit"/>
</form>
</body>
</html>

Sep 19 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.