Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] RE: Invoke onclick event of one button from clicking a second button
- From: javascript@xxxxxxxxxx (George Tsang)
- Subject: [Javascript] RE: Invoke onclick event of one button from clicking a second button
- Date: Tue, 10 Sep 2002 22:17:22 -0400
This is a multi-part message in MIME format. ------=_NextPart_000_0001_01C25917.D6B9B5D0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Thanks Harry for your help. However, I had tried the same way you'd shown in the past and it did NOT work on Netscape 6. I tried again just now and it still does not work on my machine using Netscape 6. (IE 5.5 works fine.) If you know another way that works please let me know. Thanks. -----Original Message----- From: javascript-admin@xxxxxxxxxx [mailto:javascript-admin@xxxxxxxxxx] On Behalf Of George Tsang Sent: Monday, September 09, 2002 4:59 PM To: Javascript@xxxxxxxxxx Subject: [Javascript] Invoke onclick event of one button from clicking a second button Greetings, I have set up the following: <button id="abutton" onclick="alert('A clicked')">A</button> <br> <button id="bbutton" onclick="stuff = document.getElementById ('abutton'); stuff.click()">B</button> ----------------------- George, You could try this: <button id="bbutton" onclick="document.getElementById('abutton').click()">B</button> Works in Moz1.1. Regards, Harry ------=_NextPart_000_0001_01C25917.D6B9B5D0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable <html xmlns:o=3D"urn:schemas-microsoft-com:office:office" = xmlns:w=3D"urn:schemas-microsoft-com:office:word" = xmlns:st1=3D"urn:schemas-microsoft-com:office:smarttags" = xmlns=3D"http://www.w3.org/TR/REC-html40"> <head> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; = charset=3Dus-ascii"> <meta name=3DProgId content=3DWord.Document> <meta name=3DGenerator content=3D"Microsoft Word 10"> <meta name=3DOriginator content=3D"Microsoft Word 10"> <link rel=3DFile-List href=3D"cid:filelist.xml@xxxxxxxxxxxxxxxxx"> <o:SmartTagType = namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags" name=3D"time"/> <o:SmartTagType = namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags" name=3D"date"/> <!--[if gte mso 9]><xml> <o:OfficeDocumentSettings> <o:DoNotRelyOnCSS/> </o:OfficeDocumentSettings> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:SpellingState>Clean</w:SpellingState> <w:GrammarState>Clean</w:GrammarState> <w:DocumentKind>DocumentEmail</w:DocumentKind> <w:EnvelopeVis/> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:UseFELayout/> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if !mso]> <style> st1\:*{behavior:url(#default#ieooui) } </style> <![endif]--> <style> <!-- /* Font Definitions */ @font-face {font-family:PMingLiU; panose-1:2 2 3 0 0 0 0 0 0 0; mso-font-alt:\65B0\7D30\660E\9AD4; mso-font-charset:136; mso-generic-font-family:roman; mso-font-pitch:variable; mso-font-signature:3 137232384 22 0 1048577 0;} @font-face {font-family:"\@PMingLiU"; panose-1:2 2 3 0 0 0 0 0 0 0; mso-font-charset:136; mso-generic-font-family:roman; mso-font-pitch:variable; mso-font-signature:3 137232384 22 0 1048577 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:PMingLiU;} a:link, span.MsoHyperlink {color:blue; text-decoration:underline; text-underline:single;} a:visited, span.MsoHyperlinkFollowed {color:purple; text-decoration:underline; text-underline:single;} span.EmailStyle17 {mso-style-type:personal-compose; mso-style-noshow:yes; mso-ansi-font-size:10.0pt; mso-bidi-font-size:10.0pt; font-family:Arial; mso-ascii-font-family:Arial; mso-hansi-font-family:Arial; mso-bidi-font-family:Arial; color:windowtext;} span.SpellE {mso-style-name:""; mso-spl-e:yes;} span.GramE {mso-style-name:""; mso-gram-e:yes;} @page Section1 {size:612.0pt 792.0pt; margin:72.0pt 90.0pt 72.0pt 90.0pt; mso-header-margin:36.0pt; mso-footer-margin:36.0pt; mso-paper-source:0;} div.Section1 {page:Section1;} --> </style> <!--[if gte mso 10]> <style> /* Style Definitions */=20 table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman";} </style> <![endif]--> </head> <body lang=3DEN-US link=3Dblue vlink=3Dpurple = style=3D'tab-interval:36.0pt'> <div class=3DSection1> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"'>Thanks Harry for your help.<o:p></o:p></span></font></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'><o:p> </o:p></span></font></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"'>However, I had tried the same way you’d shown in the past and it did NOT = work on Netscape 6.<o:p></o:p></span></font></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'><o:p> </o:p></span></font></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"'>I tried again just now and it still does not work on my machine using = Netscape 6. (IE 5.5 works fine.)<o:p></o:p></span></font></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'><o:p> </o:p></span></font></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"'>If you know another way that works please let me = know.<o:p></o:p></span></font></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'><o:p> </o:p></span></font></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'>Thanks.<o:p></o:p></span></font></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'><o:p> </o:p></span></font></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"'>-----Original Message-----<o:p></o:p></span></font></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"'>From: javascript-admin@xxxxxxxxxx [<a = href=3D"mailto:javascript-admin@xxxxxxxxxx">mailto:javascript-admin@LaTec= h.edu</a>]<o:p></o:p></span></font></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"'>On Behalf Of George Tsang<o:p></o:p></span></font></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"'>Sent: </span></font><st1:date Month=3D"9" Day=3D"9" Year=3D"2002"><font = size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"'>Monday, September 09, 2002</span></font></st1:date><font size=3D2 = face=3D"Courier New"><span style=3D'font-size:10.0pt;font-family:"Courier New"'> = </span></font><st1:time Hour=3D"16" Minute=3D"59"><font size=3D2 face=3D"Courier New"><span = style=3D'font-size: 10.0pt;font-family:"Courier New"'>4:59 PM</span></font></st1:time><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'><o:p></o:p></span></font></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"'>To: Javascript@xxxxxxxxxx<o:p></o:p></span></font></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"'>Subject: [<span class=3DSpellE>Javascript</span>] Invoke <span = class=3DSpellE>onclick</span> event of one button from clicking a second button = Greetings,<o:p></o:p></span></font></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"'><span style=3D'mso-spacerun:yes'> </span><o:p></o:p></span></font></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"'>I have set up the following:<o:p></o:p></span></font></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"'><span style=3D'mso-spacerun:yes'> </span><o:p></o:p></span></font></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"'><button id=3D"<span class=3DSpellE>abutton</span>" <span = class=3DSpellE>onclick</span>=3D"<span class=3DGramE>alert(</span>'A clicked')">A</button> = <o:p></o:p></span></font></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"'><<span class=3DSpellE><span class=3DGramE>br</span></span>> = <o:p></o:p></span></font></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"'><button id=3D"<span class=3DSpellE>bbutton</span>" <span = class=3DSpellE>onclick</span>=3D"stuff =3D <span class=3DSpellE>document.getElementById</span> ('<span = class=3DSpellE>abutton</span>'); <span class=3DSpellE><span class=3DGramE>stuff.click</span></span><span class=3DGramE>(</span>)">B</button><o:p></o:p></span></font= ></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"'><span style=3D'mso-spacerun:yes'> </span><o:p></o:p></span></font></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"'><span style=3D'mso-spacerun:yes'> </span><o:p></o:p></span></font></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'>-----------------------<o:p></o:p></span></font></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"'><span style=3D'mso-spacerun:yes'> </span><o:p></o:p></span></font></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'>George,<o:p></o:p></span></font></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"'><span style=3D'mso-spacerun:yes'> </span><o:p></o:p></span></font></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"'>You could try this:<o:p></o:p></span></font></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"'><button id=3D"<span class=3DSpellE>bbutton</span>" <span = class=3DSpellE>onclick</span>=3D"<span class=3DSpellE><span = class=3DGramE>document.getElementById</span></span><span class=3DGramE>(</span>'<span = class=3DSpellE>abutton</span>').click()">B</button><o:p></o= :p></span></font></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"'><span style=3D'mso-spacerun:yes'> </span><o:p></o:p></span></font></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><span class=3DGramE><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt; font-family:"Courier New"'>Works in Moz1.1.</span></font></span><font = size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'><o:p></o:p></span></font></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"'><span style=3D'mso-spacerun:yes'> </span><o:p></o:p></span></font></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'>Regards,<o:p></o:p></span></font></p> <p class=3DMsoNormal = style=3D'mso-layout-grid-align:none;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'>Harry<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> </div> </body> </html> ------=_NextPart_000_0001_01C25917.D6B9B5D0--
- Follow-Ups:
- Prev by Date: [Javascript] Re: Invoke onclick event of one button from clicking a second button
- Next by Date: [Javascript] Can you change a style at runtime?
- Previous by thread: [Javascript] Invoke onclick event of one button from clicking a second button
- Next by thread: [Javascript] RE: Invoke onclick event of one button from clicking a second button
- Index(es):