|
it seems to be that your form is closed out of scope
|
|
|
Hi Gloria,
I can't be sure how to go about this without the complete Script or how advanced you may be at programming so I will start with something simple. I am no expert let it be said hehe!! Here goes:
I once had trouble with my Forms not validating and it was a simple remedy. In the Form tag at the top make sure you state the Form to be validated by calling it's NAME as follows:
<form name="contactsubmission" action="submaildetails.asp" method="post" onSubmit="return validateForm(contactsubmission)";>
Then use the onClick EventHandler to call the Form that is in focus, i.e. the Form that is being filled in, with the flashing tab - (this would signify focus on this Form).
Sorry if this is to basic etc but this is my first real entry and to be honest in the little experience I have, I have noticed it is always the obvious thing's that we tend to forget or miss out.
Let me know how you get on.
|
|
Expert:
|
webkungfu
|
|
Date:
|
Jun 22, 2008
|
|
Time:
|
07:51
|
|
|
|
Votes: Good (0) | Bad (0) Login to rate this answer
|
|
|
Sorry I meant to show the onClick EventHandler so here it is:
<input class="2" type="submit" value="Submit Enquiry" onClick="return validateForm(form)";>
Good luck!
|
|
Expert:
|
webkungfu
|
|
Date:
|
Jun 22, 2008
|
|
Time:
|
07:54
|
|
|
|
Votes: Good (0) | Bad (0) Login to rate this answer
|
|
|
I cant find validateForm() function anywhere in your page!
a sample for validation
<script language="javascript">
function validateForm(){
form = document.myForm;
fname = form.fname.value;
fadd = form.fadd1.value;
if(fname.length<5) {
alert('Fill Name correctly');
return false;
}
if(fadd.length<20) {
alert('Fill Address correctly');
return false;
}
return true;
}
</script>
<form name="myForm" id="myForm" method="post" action="formaction.php" onsubmit="return validateForm();">
Name: <input type="text" id="fname" name="fname" value="" /> * minimum 5 letters <br/>
Address1: <input type="text" id="fadd1" name="fadd1" value="" /> * minimum 20 letters<br/>
Address2: <input type="text" id="fadd2" name="fadd2" value="" /> * optional<br/>
<input type="Submit" id="sbt" name="sbt" value="Post Form" /><br/>
</form>
Here I have added the validation function to onSubmit EventHandler of form
or you may also attach to onClick EventHandler of submit button as webkungfu told.
cheers
|
|
Expert:
|
ramanvemman
|
|
Date:
|
Jun 25, 2008
|
|
Time:
|
00:35
|
|
|
|
Votes: Good (0) | Bad (0) Login to rate this answer
|
|
|
|
|
|
|
This question has been answered, and points have been rewarded to the following experts:
| shashi.programmer: |
5 |
| webkungfu: |
35 |
| ramanvemman: |
35 |
You're welcome however to comment or give additional information or if you wish, you have the ability to write an Answer Summary for this question by clicking on the "Answer Summaries" Tab.
|
|