Robert, the way I have approached this in the past is to leverage the fact that 
the confirm function will return a true or false. Since that is the case, 
simply use it as the "test" in an IF function. If the confirm returns true, 
then exectute your second function...else return false. Something like this...

onSubmit="javascript:if(confirm('you sure man?')){ return mysecondfunction();} 
else {return false}}

Of course I just typed that up adhoc and didn't test it, but something along 
those lines.

Doug  :0)

>Did you find a solution?
>
>I'm suprised it errors. The reason it doesn't work is because you're
>potentially returning true so checkform never gets called. Try this:
>
>onsubmit="if (confirm('Are you sure?')) return checkform(this);"
>
>Untested, and I'm not sure what's returned if the user clicks the close(X)
>button on the dialog box(might be null), so maybe:
>
>onsubmit="if ( confirm('Are you sure?') == true ) return checkform(this);"
>
>would be better.
>
>Adrian
>
>-----Original Message-----
>From: Orlini, Robert [mailto:[EMAIL PROTECTED]
>Sent: 03 March 2006 20:30
>To: CF-Talk
>Subject: SOT: Two functions in OnSubmit
>
>
>Is there any way to include two return functions in an OnSubmit?
>
>Here is what I want to do: <form action="getinventory4.cfm" method="POST"
>onSubmit="return confirm('Are you sure?'); return checkform(this);">
>
>Of course it generates an error. But what will work here.
>
>Thx in advance
>
>Robert O.
>HWW

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:235727
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to