Hi Josie,
I think you have understood half, or maybe more presise I explained half
What you have done in the onload event is exactly what I am looking for, but
when a user his/her select to the date radiobutton.
This once the page has already loaded.
It is initially set to have the claimno radiobutton set, and the inputbox
accepts char, the onblur is set to a cleanchar funtion
Now when the user changes to the date radiobutton, the onblur event should
be set to a dateformat function
The example you gave, would this achieve what I am trying to do??
Hope you understand more clearly now
Thanks
Robert
"Joshie Surber" <jo**********@gmail.com> wrote in message
news:11**********************@f6g2000cwb.googlegro ups.com...
I have a form for searches on a mysql database/table. The form has on
input text box, and several pushbuttons. Depending on which pushbutton is
selected, the search is then done on a specific field. One of them isa
date field.
How can I add or change the onfocus, onblur events of the input box to
one that is relevant to the type of search being done. For example, I have
some date format and valadation function, I would like to change the inputs
onblur and onkeyup to functions specific for date, and then when region
pushbutton is selected to change those same events to one spevific for
region
Can thin be done, if not what are the alternatives.
I am not sure I understand your problem. What I think you are asking is
if you can do something like:
window.onload = function() {
window.getElementById('searchByDateRadio').onchang e = function() {
if (self.checked) window.getElementById('textBox').onblur =
valiDate;
else window.getElementById('textBox').onblur = null;
}
}
(Please excuse that I haven't tested this code, and it could be cleaned
up quite a bit)
If this is not what you are looking for, please give us some kind of
URL where we can see what you are trying to do.