Forum Moderators: open
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!
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.