G
Guest
Hi all,
I have a situation in which I need to verify that either of two textboxes
contain an entry; I'm initially uninterested in whether or not the entries
are valid, only that there is at least one entry. The validity of the entry
will be checked when I first post back the data to the server, but I don't
want to perform a postback if both textboxes are empty.
My initial thought is to write a simple javascript function to return true
if there's an entry in either box or return false if both boxes are empty. I
could then call this function from another javascript function that would
intercept the onclick event for my form's pushbutton. The problem I'm
encountering is I can't get a javascript function to work for the button's
onclick event. I created a function called ButtonClicked and have it wired
up the the button's onclick event by stating 'onclick="ButtonClicked"' in the
html code for the pushbutton, but I don't know where or how to obtain the
Object and the EventArgs my code-behind handler expects for the pushbutton.
Does anyone have a brief example or can anyone point me where I can find one?
Thanks!
I have a situation in which I need to verify that either of two textboxes
contain an entry; I'm initially uninterested in whether or not the entries
are valid, only that there is at least one entry. The validity of the entry
will be checked when I first post back the data to the server, but I don't
want to perform a postback if both textboxes are empty.
My initial thought is to write a simple javascript function to return true
if there's an entry in either box or return false if both boxes are empty. I
could then call this function from another javascript function that would
intercept the onclick event for my form's pushbutton. The problem I'm
encountering is I can't get a javascript function to work for the button's
onclick event. I created a function called ButtonClicked and have it wired
up the the button's onclick event by stating 'onclick="ButtonClicked"' in the
html code for the pushbutton, but I don't know where or how to obtain the
Object and the EventArgs my code-behind handler expects for the pushbutton.
Does anyone have a brief example or can anyone point me where I can find one?
Thanks!