P
Prodip Saha
Dear ASP.NET Gurus,
I have a TextBox control with AutoPostBack set to true to execute the server
scripts. I also, added some client script for validation.What I want
is--execute the client script and if the cleint script returns true only
then I want to execute the server scripts. Am I asking too much or is it
achievable? Please don't give me an answer like --just validate on the
server side...
Some Background:-
I have deligated an event handler to the textChanged event on the TextBox
control and I have added the client script as an attribute of the TextBox. I
have tried the code different ways but with no luck...
txtTest.Attributes.Add("onChange","IsCurrency('txtTest');");
txtTest.Attributes.Add("onChange","if(IsCurrency('txtTest')){doSomething()}e
lse ");
The first approach will add __doPostBack script automatically at the end of
the client script (after the semi colon) since I have the auto postback set
to true. Problem is --it execute both the client and server scripts.
The second approach will add __doPostback script after the "else" keyword.
This sounds a doable one. The problem is--it does not execute the server
script (i.e. the __doPostback does not get executed to submit the Form).
Thanks in advance.
Prodip Saha
I have a TextBox control with AutoPostBack set to true to execute the server
scripts. I also, added some client script for validation.What I want
is--execute the client script and if the cleint script returns true only
then I want to execute the server scripts. Am I asking too much or is it
achievable? Please don't give me an answer like --just validate on the
server side...
Some Background:-
I have deligated an event handler to the textChanged event on the TextBox
control and I have added the client script as an attribute of the TextBox. I
have tried the code different ways but with no luck...
txtTest.Attributes.Add("onChange","IsCurrency('txtTest');");
txtTest.Attributes.Add("onChange","if(IsCurrency('txtTest')){doSomething()}e
lse ");
The first approach will add __doPostBack script automatically at the end of
the client script (after the semi colon) since I have the auto postback set
to true. Problem is --it execute both the client and server scripts.
The second approach will add __doPostback script after the "else" keyword.
This sounds a doable one. The problem is--it does not execute the server
script (i.e. the __doPostback does not get executed to submit the Form).
Thanks in advance.
Prodip Saha