Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to execute more than

Status
Not open for further replies.

khue

Programmer
Mar 6, 2001
112
US
Is it possible to execute more than one functions in the onFocus() eventhandler? If so, how?

For example, is it possible like the following:

<input type=&quot;text&quot; name=&quot;test&quot; value=&quot;&quot; onFocus=&quot;chkInput1();chkInput2()&quot;>
 
Khue,

Why not just call one function and have that function call the second one.

E.g.

<script>
function chkInput2() {

.........
}

Function chkInput1() {
.............
chkInput2();
}
</script>

<input type=&quot;text&quot; name=&quot;test&quot; value=&quot;&quot; onFocus=&quot;chkInput1()&quot;>



Mise Le Meas,

Mighty :)
 
Yes, it's possible to get a two-fer, but I'm pretty sure you're supposed to separate the two functions with a comma.

good luck!:)
Paul Prewett
 
I think a semicolon should work too. The event handler doesn't require a function call, any code between the quotes should work, and the semicolon just allows you to string multiple commands on a single line.
Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top