...

View Full Version : Two function in one input field



HeadElf
06-28-2006, 10:29 PM
Can I call two function from one input field? And if so, how?

Thanks.

HeadElf

PremiumBlend
06-29-2006, 12:54 AM
You can run two functions from one event, I'm not sure what you mean by one input field though... A text field, button? Whichever it may be, just do it like this:


onmouseover="functionOne();functionTwo();" onclick="functionA();functionB();"

HeadElf
06-29-2006, 02:25 AM
<input type="text" name="Amt1" id="Amt1" size="5" onKeyPress="return tabit(this,event);return goodchars(event,'0123456789.')">


I'm missing something here, I can tell. Do I pull the "return"s?

HeadElf

Mongus
06-29-2006, 02:41 AM
If you're trying to use return to cancel the event just add a logical AND between the functions like so:
return tabit(this,event) && goodchars(event,'0123456789.');

HeadElf
06-29-2006, 03:07 AM
It works wonderfully well! <grin> My thanks!

HeadElf



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum