Select Categories Below
Advertisement
Start Your Own Q&A Site
Create your own Q&A site easily, allowing you to quickly grow a new community around any subject matter or generate new organic traffic for your existing website.
Status: Closed Points: 75 Time: 17:44 - May 07, 2008
gloria_g
Hi, experts, Please go to this web site: http://www.cookword.com/upload.php This is a form that allow users to add a recipe. You may find that: If you click the "Submit" button, nothing will happen. the javascript validateForm() function does not work. The javascript file is at: http://www.cookword.com/js/upload.js Can you show me what is wrong? Thank you. Gloria
Categories:
Add Categories
When adding more than one category, separate them with commas.
shashi.programmer
Date:: May 08, 2008
Time:: 05:04
it seems to be that your form is closed out of scope
webkungfu
Date:: Jun 22, 2008
Time:: 07:51
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.
Time:: 07:54
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!
ramanvemman
Date:: Jun 25, 2008
Time:: 00:35
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
Question Answered
This question has been closed, and points have been rewarded to the following experts:
You're welcome however to comment or give additional information or if you wish, you have the ability to write a Tutorial in the Tutorial Area.
Answer this Question
New User
Email:
Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address
Registered User
Username:
Password:
Forgot Your Password?
Enter your email address below and we will resend your login information to you.
Login Information Sent
Questions
Hi is there a way to retrieve the loop count in XSLT
how do repair this problem: every times i opened my laptop it will suddenly n...
How i get the hp pavilion dv6-3054tx laptop bottom base assembly as a sparepa...
I don't have AOL browser but privacy scan shows hundreds of files/cookies fro...
wireless keyboard has stopped working
need validation controller for textbox in java
You have 100 characters to use
Rank
Expert
Points
1.
10279
2.
6493
3.
5596
4.
4848
5.
3487
6.
2840
7.
2770
8.
2303
9.
1820
10.
917
Register today to share your knowledge with the community and be recognized and rewarded for your contributions.
Register Here
"Psst, Quomon is a great site. Pass it on." Tell a Friend | Link To Us | Save to Delicious | Digg it
Language Options
English:
Español:
Sponsors
Questions and Answers Software