Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Failure getting form data to ASP script
Old 04-27-2006, 01:30 PM Failure getting form data to ASP script
Novice Talker

Posts: 7
Trades: 0
I'm having a problem getting validated form data to my asp script. If I don't validate, the data is passed with no problem. Once I check the form for user input, the asp script does nothing. Anyone have an idea? Listed here is my function CheckForm() and my Form ID. I'm using the same form field Name in my asp script. Does the variable name change once it is verified? Thanks for your help!


function CheckForm()
{

if (document.EmailForm.SenderName.value=="" || document.EmailForm.SenderName.value.indexOf(" ")==0)
{
alert("Please enter a value for Name.");
document.EmailForm.SenderName.focus();
return false;
}

else if (document.EmailForm.EmailAddress.value=="" || document.EmailForm.EmailAddress.value.indexOf(" ")==0)
{
alert("Please enter a value for email address.");
document.EmailForm.EmailAddress.focus();
return false;
}
else if (document.EmailForm.EmailAddress.value.indexOf(at) ==-1){
alert("You have forgotten an @ in the email address")
document.EmailForm.EmailAddress.focus();
return false;
}
else if (document.EmailForm.EmailAddress.value.indexOf(dot )==-1){
alert("You have forgotten a dot in the email address")
document.EmailForm.EmailAddress.focus();
return false;
}


else if (document.EmailForm.Subject.value=="" || document.EmailForm.Subject.value.indexOf(" ")==0)
{
alert("Please enter a value for Subject.");
document.EmailForm.Subject.focus();
return false;
}


else if (document.EmailForm.Message.value=="" || document.EmailForm.Message.value.indexOf(" ")==0)
{
alert("Please enter a value for Message.");
document.EmailForm.Message.focus();
return false;
}

return true
}

************************************
Form ID Code:

<form id="EmailForm" name="EmailForm" onsubmit="return CheckForm()" action="emailformconfirm1.asp" method="post">
GClarkOX is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-03-2006, 03:23 PM Re: Failure getting form data to ASP script
funkdaddu's Avatar
Web Design Snob

Posts: 635
Trades: 0
Only trouble I ran into was I had to define "at" to be "@" and "dot" to be ".".

You may want to have the "return true" be in the else portion of the that if/else
Code:
...
alert("Please enter a value for Message.");
document.EmailForm.Message.focus();
return false;
} else {
return true
}
Other than that, I don't know.

Last edited by funkdaddu; 05-03-2006 at 03:25 PM..
funkdaddu is offline
Reply With Quote
View Public Profile Visit funkdaddu's homepage!
 
Reply     « Reply to Failure getting form data to ASP script
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.10875 seconds with 12 queries