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!

Getting an error when a textbox is left empty

Status
Not open for further replies.

at51178

Technical User
Mar 25, 2002
587
US
Hi,

I am a newbie to ASP

I created a asp page with some textboxes linked to an access database when I fill out the form and fill all the fields in the form is submitted with no problem but when I leave one of the fields blank I receive

"page cannot be displayed"

can I stop that from happening.
 
May be you are table is not accepting the null values in those fields...

You may have to make that field mandatory

-VJ
 
I am using a access database in the back end is there anyway to change it in access.
 
Check the table in design view and see if any of the fields are requiring "Not Null"

Also the error could just be somewhere in your processing page if you aren't checking for empty strings before executing functions on the (posibly empty) value (like Mid, etc)

-T

[sub]01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111[/sub]
Need an expensive ASP developer in the North Carolina area? Feel free to let me know.


 
Here's a script that will check the null value of your input boxes...just cut and paste the code ( remove the cut below & cut above ) and change the NAME of your input box to the name of the each input box in your form. Put this scripts in the <HEAD> </HEAD> html tags

<SCRIPT language=javascript>
function check(Form) {

Cut below
if (Form.name.value == "")
{
Form.name.focus();
alert("Enter your Password");
return(false);
}
Cut above


}
</SCRIPT>


Then change your <FORM> tag to :
<form name="Form" method="post" action="YourPage.asp" onsubmit="return check(this)">



 
Thanks so much for the advice

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top