RE: Two functions with a single onClick?

2001-02-22 Thread DeVoil, Nick

 Can more than one javascript function be performed with a
 single onClick?  If so, how would it be written?

Les

You can put any amount of JavaScript code in an HTML
onClick event. eg

input type = "button" onClick="doThis(x);doThat();a=b"

You are only restricted to one function if you want to
dynamically assign an event handler to a DOM object in
JavaScript.

Nick


**
Information in this email is confidential and may be privileged.
It is intended for the addressee only. If you have received it in error,
please notify the sender immediately and delete it from your system. 
You should not otherwise copy it, retransmit it or use or disclose its
contents to anyone. 
Thank you for your co-operation.
**

~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: Two functions with a single onClick?

2001-02-22 Thread David Berger

input type=button . onClick="javascript:function1();function2();"

Or you could call function2() from function1()


From: zac [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Subject: Re: Two functions with a single onClick?
Date: Wed, 21 Feb 2001 21:17:13 -0800

  Can more than one javascript function be performed with a single
  onClick?  If so, how would it be written?

Write one function that handles both tasks and then call that function in
the onClick statement.

What two tasks are you trying to do?



--

It is dangerous to be right when the government is wrong.

Voltaire


email: [EMAIL PROTECTED]
web: http://www.pixelgeek.com/



~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Two functions with a single onClick?

2001-02-22 Thread Howarth, Craig (IBK-NY)

Simply seperate the two function calls with a semicolon, as in onClick="alert('hi'); 
alert('bye');".  Or write one function that calls the two functions.

Craig

 -Original Message-
 From: Les Irvin [SMTP:[EMAIL PROTECTED]]
 Sent: Wednesday, February 21, 2001 11:16 PM
 To:   CF-Talk
 Subject:  Two functions with a single onClick?
 
 Can more than one javascript function be performed with a single 
 onClick?  If so, how would it be written?
 Thanks,
 Les 
 
 

~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Two functions with a single onClick?

2001-02-21 Thread David Baskin

Les, here's some code for you. HTH.

david
-

!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"

html
head
titleUntitled/title
script language="JavaScript"
!--
function doTwo(){
doFirst();
doSecond();
}

function doFirst(){
alert("I'm the first function");
}

function doSecond(){
alert("I'm the second function");
}
// --
/script
/head

body
form name="myForm"
run two javascript functions by clicking on this button: input
type="Button" name="clickMe" onclick="doTwo();" value=" Click Me! "
/form

/body
/html

-Original Message-
From: Les Irvin [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 21, 2001 2:58 PM
To: CF-Talk
Subject: Two functions with a single onClick?


Can more than one javascript function be performed with a single
onClick?  If so, how would it be written?
Thanks,
Les
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Two functions with a single onClick?

2001-02-21 Thread Charlie McCormack

One way would be to have the onclick event call one fuction that in turn
calls the next function.


 -Original Message-
 From: Les Irvin [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, February 22, 2001 9:58 AM
 To: CF-Talk
 Subject: Two functions with a single onClick?


 Can more than one javascript function be performed with a single
 onClick?  If so, how would it be written?
 Thanks,
 Les



~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Two functions with a single onClick?

2001-02-21 Thread Phoeun Pha

like let's say i wanna do 3 functions.  i write the functions in the
javascript.  then i clal them in the OnClick

let's say those functions are GetPie, GetPizza, GetLaid

the onclick would be like.  onclick="GetPie();GetPizza(), GetLaid"

-Original Message-
From: Les Irvin [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 21, 2001 4:58 PM
To: CF-Talk
Subject: Two functions with a single onClick?


Can more than one javascript function be performed with a single 
onClick?  If so, how would it be written?
Thanks,
Les
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Two functions with a single onClick?

2001-02-21 Thread Scott Cavanaugh

onclick="function1(); function2();"

-Original Message-
From: Les Irvin [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 21, 2001 2:58 PM
To: CF-Talk
Subject: Two functions with a single onClick?


Can more than one javascript function be performed with a single 
onClick?  If so, how would it be written?
Thanks,
Les
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Two functions with a single onClick?

2001-02-21 Thread Joby Bednar

onClick="function1();function2()"

Joby Bednar
Director of Internet Design
iNEOgroup.com
http://www.ineogroup.com http://www.ineogroup.com
Fusing your Dreams and the Web, Together as One
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
Cell:  949-283-5138
Personal Fax:  208-485-1170


-Original Message-
From: Les Irvin [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 21, 2001 2:58 PM
To: CF-Talk
Subject: Two functions with a single onClick?


Can more than one javascript function be performed with a single
onClick?  If so, how would it be written?
Thanks,
Les
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Two functions with a single onClick?

2001-02-21 Thread Darryl Lyons

or you can just call both functions from the onClick event like so:
onclick="doOne(); doTwo()"

-Original Message-
From: David Baskin [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 22, 2001 9:27 AM
To: CF-Talk
Subject: RE: Two functions with a single onClick?


Les, here's some code for you. HTH.

david
-

!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"

html
head
titleUntitled/title
script language="JavaScript"
!--
function doTwo(){
doFirst();
doSecond();
}

function doFirst(){
alert("I'm the first function");
}

function doSecond(){
alert("I'm the second function");
}
// --
/script
/head

body
form name="myForm"
run two javascript functions by clicking on this button: input
type="Button" name="clickMe" onclick="doTwo();" value=" Click Me! "
/form

/body
/html

-Original Message-
From: Les Irvin [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 21, 2001 2:58 PM
To: CF-Talk
Subject: Two functions with a single onClick?


Can more than one javascript function be performed with a single
onClick?  If so, how would it be written?
Thanks,
Les
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Two functions with a single onClick?

2001-02-21 Thread Scott, Andrew



Depending on your tag and if it is supported, I have used the inout tag to
give you an idea


script
function Test() {
 alert("Hello")
 alert("Function call #2")
 return true;
}

/script
form

 input type="submit" name="test" onClick="Test();"

/form


-Original Message-
From: Les Irvin [mailto:[EMAIL PROTECTED]]
Sent: 22 February 2001 09:58
To: CF-Talk
Subject: Two functions with a single onClick?


Can more than one javascript function be performed with a single 
onClick?  If so, how would it be written?
Thanks,
Les
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Two functions with a single onClick?

2001-02-21 Thread mjones

Haven't used this with onclick, but this works with onsubmit, so I imagine
it would be no different
onsubmit="javascript:MyFunction1();javascript:MyFunction2();javascript:MyFun
ction3();javascript:MyFunction4();"

-Original Message-
From: Les Irvin [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 21, 2001 4:58 PM
To: CF-Talk
Subject: Two functions with a single onClick?


Can more than one javascript function be performed with a single 
onClick?  If so, how would it be written?
Thanks,
Les
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: Two functions with a single onClick?

2001-02-21 Thread Jon Hall

In addition to calling a custom function, you can also string javascript
calls in your onClick like so.

a href="#" onClick="opener.focus();window.close();"Close/a

jon
- Original Message -
From: "Les Irvin" [EMAIL PROTECTED]
To: "CF-Talk" [EMAIL PROTECTED]
Sent: Wednesday, February 21, 2001 5:57 PM
Subject: Two functions with a single onClick?


 Can more than one javascript function be performed with a single
 onClick?  If so, how would it be written?
 Thanks,
 Les



~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: Two functions with a single onClick?

2001-02-21 Thread Richard Ramos

You could just put them all together.  The following code works for me.  We
have an upload link that opens a page, places today's date in a text input
box and sets a hidden variable.  Pretty crazy, but I had to do it this way
because I had dynamic variables to pass to the new window and which text box
and variable.  Here's the anchor tag I use to do all three functions at
once.

a href="##Language-#ProductionID#"

onClick="window.document.form1.BackUpDate#productionid#.value='#DateFormat(n
ow(), 'mm/dd/yy'#';
window.document.form1.FinalFiles.value='1';

window.open('upload.cfm?ProcessID=8LangID=#LanguageID#OrderID=#OrderID#',
'newwindow', 'height=350,width=600')")"
Upload/abr

Works like a charm, but I've only tested with IE.

Richard Ramos
Network Administrator
Softitler Net, Inc.
www.softitler.com
[EMAIL PROTECTED]

- Original Message -
From: "Les Irvin" [EMAIL PROTECTED]
To: "CF-Talk" [EMAIL PROTECTED]
Sent: Wednesday, February 21, 2001 2:57 PM
Subject: Two functions with a single onClick?


 Can more than one javascript function be performed with a single
 onClick?  If so, how would it be written?
 Thanks,
 Les



~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: Two functions with a single onClick?

2001-02-21 Thread Scott Weikert

Couldn't you simply do

onClick="doFirst();doSecond();"

? I often use this method (though not with functions per se) with forms
with 'multiple submit' buttons... first submit button is straight up, second
is a type=button with
'onClick="document.formname.action=(somethingelse);document.formname.submit(
);" on it, to divert the form elsewhere and submit it.

- Original Message -
From: "David Baskin" [EMAIL PROTECTED]
To: "CF-Talk" [EMAIL PROTECTED]
Sent: Wednesday, February 21, 2001 4:27 PM
Subject: RE: Two functions with a single onClick?


 Les, here's some code for you. HTH.

 david
 -

 !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"

 html
 head
 titleUntitled/title
 script language="JavaScript"
 !--
 function doTwo(){
 doFirst();
 doSecond();
 }

 function doFirst(){
 alert("I'm the first function");
 }

 function doSecond(){
 alert("I'm the second function");
 }
 // --
 /script
 /head

 body
 form name="myForm"
 run two javascript functions by clicking on this button: input
 type="Button" name="clickMe" onclick="doTwo();" value=" Click Me! "
 /form

 /body
 /html

 -Original Message-
 From: Les Irvin [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, February 21, 2001 2:58 PM
 To: CF-Talk
 Subject: Two functions with a single onClick?


 Can more than one javascript function be performed with a single
 onClick?  If so, how would it be written?
 Thanks,
 Les

~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Two functions with a single onClick?

2001-02-21 Thread Scott, Andrew

I would worry about using that many javascript:'s the following would do the
same thing:-)

onsubmit="javascript:MyFunction1(); MyFunction2(); MyFunction3);
MyFunction4();"





-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 22 February 2001 10:53
To: CF-Talk
Subject: RE: Two functions with a single onClick?


Haven't used this with onclick, but this works with onsubmit, so I imagine
it would be no different
onsubmit="javascript:MyFunction1();javascript:MyFunction2();javascript:MyFun
ction3();javascript:MyFunction4();"

-Original Message-
From: Les Irvin [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 21, 2001 4:58 PM
To: CF-Talk
Subject: Two functions with a single onClick?


Can more than one javascript function be performed with a single 
onClick?  If so, how would it be written?
Thanks,
Les
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Two functions with a single onClick?

2001-02-21 Thread ron

 Haven't used this with onclick, but this works with onsubmit, so I imagine
 it would be no different
 onsubmit="javascript:MyFunction1();javascript:MyFunction2();javasc
 ript:MyFun
 ction3();javascript:MyFunction4();"

No need for the "javascript:" entries there; the language is assumed in an
onSubmit (or any other event).

Ron Allen Hornbaker
President/CTO
Humankind Systems, Inc.
http://humankindsystems.com
mailto:[EMAIL PROTECTED]




~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Two functions with a single onClick?

2001-02-21 Thread Jeff Howden

--
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]

 Haven't used this with onclick, but this
 works with onsubmit, so I imagine it would
 be no different
--

an event handler is an event handler.  they all work fundamentally the
same -- they wait for interaction in some form from the user and execute the
statements contained in their value.

--
 onsubmit="javascript:MyFunction1();
   javascript:MyFunction2();
   javascript:MyFunction3();
   javascript:MyFunction4();"
--

you do not need to include "javascript:" (without the quotes) in event
handlers when calling functions.  the browser assumes that the event handler
is referring to javascript.  what's worse is that including the
"javascript:" will cause it to not work or work bizarrely in some browsers.

onsubmit="MyFunction1();
  MyFunction2();
  MyFunction3();
  MyFunction4();"

good luck,

..jeff

name://jeff.howden
game://web.development
http://www.evolt.org/
mailto:[EMAIL PROTECTED]


~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: Two functions with a single onClick?

2001-02-21 Thread zac

 Can more than one javascript function be performed with a single
 onClick?  If so, how would it be written?

Write one function that handles both tasks and then call that function in
the onClick statement.

What two tasks are you trying to do?



-- 

It is dangerous to be right when the government is wrong.

Voltaire


email: [EMAIL PROTECTED]
web: http://www.pixelgeek.com/


~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists