| bw - Sep-10-2003 server time | ||||
You needed to put the submit of the form into the javascript something like this add this script at the end of all checks: if (len(errorMsg)=0)){ form.submit(); } Delete onSubmit="return CheckForm()" from the |
| Red Squirrel - Mar-14-2003 server time |
| Yep, MS != consistant |
| megaspaz - Mar-14-2003 server time | ||
m$ tech. i would occassionally have that same problem with vc++. don't know why it happens, but it does. |
| fernan82 - Mar-13-2003 server time |
| Its fixed, i'm not sure why it was doing that, i changed a line of ASP code and then changed it back to what it originally was and next time i ran the script it was working fine so i still have no idea what the prob. was........but now it's working fine.... |
| rovingcowboy - Mar-13-2003 server time |
| not sure what the trouble was? it will submit empty form if that is what you want. do you not want it to submit empty form? if so then you need to add line for it to insist there is something in the comment area before it is sent. you know you seen the forms online that require certin information. same thing is needing to be done here. cant remember the code but will look for it and let you know. mean time you can look for it at javascripts.com i believe that is it. you can also get the first page 2000 program and use its feature of checking the page before it previews it. then it will say what and where the error is. or if there is any. it also has the must have filled code in its code sections. |
| fernan82 - Mar-13-2003 server time |
| Looks like it fixed itself |
| Red Squirrel - Mar-13-2003 server time |
| Yeah this board supports html, it can come handy, but I always keep an eye out for trouble makers. As for your code, I'm not sure, I don't really know javascript. Oh, I moved this to the coding forum. |
| fernan82 - Mar-13-2003 server time | ||
Oh well here's the code:
I didn't knew you had to do that to post the code... |
| fernan82 - Mar-13-2003 server time | |
| I'm making a form and when I hit submit it will submit the form even if I leave everything blank...............what am i doing wrong?? here's the code: <script language="JavaScript"> <!-- Hide from older browsers... //Function to check form is filled in correctly before submitting function CheckForm () { var errorMsg = ""; //Check for a Subject if (document.frmPMs.pmSubject.value==""){ errorMsg += "\n\tYou must enter a subject."; } //Check for a Message Body if (document.frmPMs.pmBody.value==""){ errorMsg += "\n\tYou must enter a message body."; } //If there is aproblem with the form then display an error if (errorMsg != ""){ msg = "_______________________________________________________________\n\n"; msg += "The form has not been submitted because there are problem(s) with the form.\n"; msg += "Please correct the problem(s) and re-submit the form.\n"; msg += "_______________________________________________________________\n\n"; msg += "The following field(s) need to be corrected: -\n"; errorMsg += alert(msg + errorMsg + "\n\n"); return false; } return true; } // --> |