Re: Two functions in OnSubmit

2006-03-19 Thread S . Isaac Dealey
The "if" statement isn't a function, and event handlers like onSubmit don't require the javascript: prefix. I.e. onsubmit="if (confirm('are you sure?')==true) { return function2(); } else { return false; }" also works. I try to include the == true with javascript because js is known to treat non-bo

Re: Two functions in OnSubmit

2006-03-19 Thread rhymes with 'loud'
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

RE: Two functions in OnSubmit

2006-03-19 Thread Adrian Lynch
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 cl