gromul
asked on
Javascript client-side validation for ASP.NET
How do I refer to ASP.NET controls (textboxes...) in Javascript?
Thanks
Thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
@x_com: Yeah, I noticed it, but I didn't know that's how you do it in javascript also. And javascript somehow doesn't work on my machine, so I can't test it yet.
what about plain old simple ...
document.urformname.textbo xname.valu e;
does this not work??
document.urformname.textbo
does this not work??
document.getElementById should work in most cases....
nishikanth's said is right. We can use document.getElementById to identify all the web controls. That's why we need to assign an unique ID for each web control that we're using now.
>> I noticed it, but I didn't know that's how you do it in javascript also. And javascript somehow doesn't work on my machine, so I can't test it yet.
-My sample already shown in both client-script include with js function. What browser you're using?Try to re-enable the browser to support client-side scripting.
>> I noticed it, but I didn't know that's how you do it in javascript also. And javascript somehow doesn't work on my machine, so I can't test it yet.
-My sample already shown in both client-script include with js function. What browser you're using?Try to re-enable the browser to support client-side scripting.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks guys.
ASKER
Thanks guys.
<Script language="javascript">
function ButtonClicked()
{
document.form1.textbox1.va lue="Srika nth"
alert( document.form1.textbox1.va lue)
/*Here form1 --> is name or id of the form in which your control is present.
textbox1 --> name or id of the textbox.*/
}
</script>
function ButtonClicked()
{
document.form1.textbox1.va
alert( document.form1.textbox1.va
/*Here form1 --> is name or id of the form in which your control is present.
textbox1 --> name or id of the textbox.*/
}
</script>
I'd answer your question in this post :
http://oldlook.experts-exchange.com/questions/20909883/Custom-Validator-with-VBScript.html.