how to validate the not acppting null values for aspx design page

Posted by Venky.Net under ASP.NET on 9/10/2012 | Points: 10 | Views : 759 | Status : [Member] | Replies : 1
i am creating a aspx page this page have the four text box and two dropdownlist.i am not enter the input values click the submit button values to validate the not accepting null values in my aspx page.


Posted by: Johnbhatt on: 9/10/2012 [Member] Starter | Points: 25

Put JavaScript like this in Head Section

<script language="javascript" type="text/javascript">

function ValidateForm()
if (document.getElementById("<%=txtSuppName.ClientID%>").value == null)
alert("Supplier Name can not be Empty!");
return false;
return true;

Here Change your ID of Textboes in javaScript and apply in the Button in below way.
OnClientClick="return ValidateForm();"

John Bhatt
Glad to Know, Free to Share.....

Venky.Net, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response