Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Receiving blank form results

Status
Not open for further replies.

3112005

Technical User
Nov 28, 2005
58
US
I created an online submit form for one of my websites. The person that receives the results is complaining that they keep getting emails from the form with nothing filled in. Is there something causing this other than a user just hitting submit without filling in their info?

Thanks.
 
Is there something causing this other than a user just hitting submit without filling in their info?

It's impossible to answer that question. However, you could put up some checks using javascript to ensure that the fields are filled out before the page is submitted. You would have to double your efforts and check again server side as well to ensure that nobody disables javascript to get around your client-side checks. After you've done this check to see if more emails are coming in blank. If not, then you've solved your problem.

-kaht

Looking for a puppy?

silky-icon-left.gif
[small]Silky Terriers are small, relatively odorless dogs that shed no fur and make great indoor pets.[/small]
silky-icon-right.gif
 
I do have it check to ensure all required fields are filled out. How do you check server side to ensure no-one disables javascript?

Thanks!
 
How do you check server side to ensure no-one disables javascript?
You can't


Well.... that's not entirely true. You could use do something like this:
Code:
<script type="text/javascript">
function blah() {
   document.getElementById("scriptEnabledTest").value = 1;
}
</script>
<form>
<input type="hidden" value="0" name="scriptEnabledTest" />
</form>
When the form is submitted you can check server side to see what the value of "scriptEnabledTest" is. If it's 0, then scripting is disabled - because javascript would have set the value equal to 1 if scripting was enabled.

However, there is no method like checkForEnabledScripting or anything like that to find out automatically. You would have to do some test yourself like I posted above.

-kaht

Looking for a puppy?

silky-icon-left.gif
[small]Silky Terriers are small, relatively odorless dogs that shed no fur and make great indoor pets.[/small]
silky-icon-right.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top