On Tue, 15 Jul 2008, cretzel wrote:
> I've got a Button and a TextField within a Form. The TextField uses an
> AjaxUpdatingBehavior for validation, which is fired "onchange". The Button
> submits the form via Ajax "onclick". In my case, sometimes the onchange
> event occurs after the onclick event (on the clientside), which causes
> problems. This is only a problem in IE(6) and not in FF. In FF the onchange
> event always occurs before the onclick event. And even in IE in simple

Are you sure that it always works in Firefox? Sounds like it 
could be a race condition. People who know Javascript and 
HTML better than me have told me that the browser event 
model is not too well defined.

Anyway, if your intent to only validate when the textfield 
loses focus? If it would be OK to validate on each keypress,
you could try using OnChangeAjaxBehavior in the TextField.

Another possibility would be to disable the submit button 
until the validation does not pass -- but then if you want
to click the button directly when the focus is still on the
field, it gets kind of clumsy.

And yet another possibility is to add the extra check in 
the Button event handler... and just run the validation 
manually from there before submit if needed.

Best wishes,
Timo

-- 
Timo Rantalaiho           
Reaktor Innovations Oy    <URL: http://www.ri.fi/ >

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to