but iwant a javacript validation . when i will submit button it will show an alert box
The condion is like that:-
if dropdowlist value is P
alert('textbox should not blank')
if dropdowlist value is L
then alert will not show.
i want in javascript. how i will do plz give me solution
Sanjeeb LenkaPosted Sep 16, 2013, 3:41 AM
ranjan sahooPosted Sep 16, 2013, 3:34 AM
Sanjeeb LenkaPosted Sep 16, 2013, 3:10 AM
you can try like this to call a javascript function from .cs or code behind
Page.ClientScript.RegisterStartupScript(this.GetType(),"Call my function","MyFunction()",true);
MyFunction() is the javascript function
ranjan sahooPosted Sep 16, 2013, 3:06 AM
Sanjeeb LenkaPosted Sep 16, 2013, 3:00 AM
its working for me perfectly. plz share your code i will check that.
ranjan sahooPosted Sep 16, 2013, 2:57 AM
Sanjeeb LenkaPosted Sep 16, 2013, 2:56 AM
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
ranjan sahooPosted Sep 16, 2013, 2:46 AM
Sanjeeb LenkaPosted Sep 16, 2013, 2:28 AM
try this:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
Sanjay KumarPosted Sep 16, 2013, 2:24 AM
http://www.codeproject.com/Tips/404274/Client-Side-Validation-using-JavaScript