Ask a Question related to ASP.NET General, Design and Development.
-
ganesh kolappan #1
image/imagebutton client validation
Hi
is there any way i can call a clientside function for validation onClick of
a Image or imagebutton?
Right now my image or imagebutton is submitting to the server, even it
return false from the clientside function.
my sample code has,
..aspx code:
-------------
function validateme()
{
if ((document.Form1.pwdOldPwd.value != "") ||
(document.Form1.pwdNewPwd.value != "") || (document.Form1.pwdRenterPwd.value
!= ""))
{
if (document.Form1.pwdOldPwd.value == "")
{
htlOldPwd.innerText = "Old Password Required";
document.Form1.pwdOldPwd.focus();
return false;
}
else
htlNewPwd.innerText = " ";
}
else
htlNewPwd.innerText = " ";
return true;
}
<input type="image" id="imgSubmit" src="images/bt_changepassword.gif"
runat="server" onServerClick = "submitme">
codebehind:
--------------
'imgSubmit.Attributes.Add("onClick", "if ( validateme() ) ")
Any ideas??
Thanks
Ganesh kolappan.
ganesh kolappan Guest
-
An ImageButton that retrieves its image from a Resource
I can't find any documentation on retrieving an imagebutton's image from a resource file in asp.net 2.0. Can someone help with a small example or... -
Help with asp:imagebutton image path
Hi I'm a little stuck and hoping for some advice, asp.net vb I have a datalist on a page to show users thumbnails, the photos are displayed as... -
Need to change image of imagebutton in datagrid template column
I'm going nuts.. I've got a template column with an imagebutton in it. I would like to change the image on the button when the button is clicked. ... -
Client Validation without Js
Hi....I have a problem with my asp page, when it have diferent controls and some validation control...but i want to validate just some controls if... -
validation summary doesnt display when there's client-side validation
I have a custom validator that validates a numeric field, txtField, that allows for thousand separators. I also placed a validation summary so... -
Karl Seguin #2
Re: image/imagebutton client validation
Have you looked at client-side customvalidators?
[url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mwsdk/html/mwlrfcustomvalidatorclass.asp[/url]
Karl
"ganesh kolappan" <hookit2000@yahoo.com> wrote in message
news:OeW4foXQDHA.2832@TK2MSFTNGP10.phx.gbl...of> Hi
>
> is there any way i can call a clientside function for validation onClick(document.Form1.pwdRenterPwd.value> a Image or imagebutton?
> Right now my image or imagebutton is submitting to the server, even it
> return false from the clientside function.
>
> my sample code has,
> .aspx code:
> -------------
> function validateme()
> {
> if ((document.Form1.pwdOldPwd.value != "") ||
> (document.Form1.pwdNewPwd.value != "") ||> != ""))
> {
> if (document.Form1.pwdOldPwd.value == "")
> {
> htlOldPwd.innerText = "Old Password Required";
> document.Form1.pwdOldPwd.focus();
> return false;
> }
> else
> htlNewPwd.innerText = " ";
> }
> else
> htlNewPwd.innerText = " ";
>
> return true;
> }
>
> <input type="image" id="imgSubmit" src="images/bt_changepassword.gif"
> runat="server" onServerClick = "submitme">
>
> codebehind:
> --------------
> 'imgSubmit.Attributes.Add("onClick", "if ( validateme() ) ")
>
> Any ideas??
>
> Thanks
>
> Ganesh kolappan.
>
>
>
>
Karl Seguin Guest
-
David Waz... #3
image/imagebutton client validation
....attribute.add("OnClick","return validateMe();")
validation onClick of>-----Original Message-----
>Hi
>
>is there any way i can call a clientside function forserver, even it>a Image or imagebutton?
>Right now my image or imagebutton is submitting to the(document.Form1.pwdRenterPwd.value>return false from the clientside function.
>
>my sample code has,
>..aspx code:
>-------------
>function validateme()
> {
> if ((document.Form1.pwdOldPwd.value != "") ||
>(document.Form1.pwdNewPwd.value != "") ||src="images/bt_changepassword.gif">!= ""))
> {
> if (document.Form1.pwdOldPwd.value == "")
> {
> htlOldPwd.innerText = "Old Password Required";
> document.Form1.pwdOldPwd.focus();
> return false;
> }
> else
> htlNewPwd.innerText = " ";
> }
> else
> htlNewPwd.innerText = " ";
>
> return true;
> }
>
><input type="image" id="imgSubmit"() ) ")>runat="server" onServerClick = "submitme">
>
>codebehind:
>--------------
>'imgSubmit.Attributes.Add("onClick", "if ( validateme>
>Any ideas??
>
>Thanks
>
>Ganesh kolappan.
>
>
>
>
>.
>David Waz... Guest



Reply With Quote

