Forum Moderators: open

Message Too Old, No Replies

Onblur for multiple DIVs

         

sebana

12:14 pm on Jul 12, 2008 (gmt 0)

10+ Year Member



Hi guys, I've a problem with onblur with DIV containers, and I'd be elated if you could offer help!

I've several DIVs, of which contain identified forms. I wish to submit each form AJAXically in the event that the DIV which encompasses the form is blurred out. I don't know how it should be exactly in code, pseudoly, it looks something like:

[codes]
<div onblur="submitform(1);">
<form id="1"></form>
</div>

<div onblur="submitform(2);">
<form id="2"></form>
</div>

<div onblur="submitform(3);">
<form id="3"></form>
</div>
[/codes]

I read that onblurs do not work with DIVs, just inputs. Is there a way I can do this with DIVs? Any help is appreciated, thank you!

poppyrich

12:31 am on Jul 13, 2008 (gmt 0)

10+ Year Member



onblur will work with divs.

However, I question the approach your taking here. onblur just doesn't feel like the right event. It might be wise to take a step back.

You have multiple forms contained within divs, that much I get.
What do the forms contain? Stuff that the user fills out? Just input buttons, what?

I'd like to see the HTML for at least one of the forms.

I mean, you don't want empty forms being submitted, and using onblur, that's where you're heading IMHO.