Munson, Jacob wrote:
> Could you wrap the qForms function in another one?  Like so:
> <form ... onSubmit="qFormsWrapper()">
>
> JS func:
> function qFormsWrapper() {
>   if (!workDone) {
>     qForms();
>     workDone++;
>   }
> }
>
>   
I don't believe so, as you have to set some qForms-specific JS code 
before and after your <form></form> tags - and the qForms functions get 
called automatically when the form submits.

I seem to have found a way around my problem, though. I'm using a var 
'enterCheck' and setting it high when I *don't* want my homegrown 
validation to kick - and surrounding that function with "if (enterCheck 
== 0)" and then resetting enterCheck back to 0 at the end of that 
function (to clear the deck, so to speak).

I picked up a function (thank you Google) for intercepting when return 
is pressed, basically returning false if so - and added 'enterCheck=1' 
just before the return-false bit. That way when my homegrown function 
calls, it finds that var set high, skips past, resets.

I also added "onMouseDown='enterCheck=1'" into my submit button's 
<input> tag. Since I'm using onMouseDown, that happens on the click of 
the mouse, but before the mouse is released (which is when the form 
submits). So I'm getting my enterCheck val set high prior to the form 
submittal - and again, now that the email fields is blurred and my 
validation kicks, it'll skip.

Seems to be working alright both with trying to submit via return and 
submit via the submit button. My validation doesn't kick, just qForms. 
But if I focus and blur the email field, my validation kicks as desired.

FYI the main reason I did my own validation using Ajax was so I could 
tap my DB and see if the email address in the field was present in 
another record (I pass along the table ID field value, either 0 for a 
new record or the existing record's ID if it's an edit), so a user 
doesn't have to get the "oh that email's already in use" message AFTER 
submitting etc. Convenience factor thing. *shrug* And that works like a 
champ.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:262960
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to