<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Simulate a button click via JavaScript</title>
	<atom:link href="http://www.randomsnippets.com/2008/03/05/simulate-a-button-click-via-javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.randomsnippets.com/2008/03/05/simulate-a-button-click-via-javascript/</link>
	<description>Random Snippets of Code and Ideas for any Web Developer</description>
	<pubDate>Fri, 19 Mar 2010 23:52:29 +0000</pubDate>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>By: drei</title>
		<link>http://www.randomsnippets.com/2008/03/05/simulate-a-button-click-via-javascript/#comment-11306</link>
		<dc:creator>drei</dc:creator>
		<pubDate>Tue, 09 Feb 2010 15:58:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.randomsnippets.com/2008/03/05/simulate-a-button-click-via-javascript/#comment-11306</guid>
		<description>I was looking for this exactly. Very helpful! Cheers!</description>
		<content:encoded><![CDATA[<p>I was looking for this exactly. Very helpful! Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sophie</title>
		<link>http://www.randomsnippets.com/2008/03/05/simulate-a-button-click-via-javascript/#comment-10420</link>
		<dc:creator>Sophie</dc:creator>
		<pubDate>Thu, 14 Jan 2010 10:48:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.randomsnippets.com/2008/03/05/simulate-a-button-click-via-javascript/#comment-10420</guid>
		<description>Is that possible to send a parametter to the submit button ? I have a VB function in the code beheind and i had multiple button who are supposed to active the VB function but whith a parametter. How can i do that ?

Thanks for the exemple by the way :)
(and sorry for my english)</description>
		<content:encoded><![CDATA[<p>Is that possible to send a parametter to the submit button ? I have a VB function in the code beheind and i had multiple button who are supposed to active the VB function but whith a parametter. How can i do that ?</p>
<p>Thanks for the exemple by the way :)<br />
(and sorry for my english)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://www.randomsnippets.com/2008/03/05/simulate-a-button-click-via-javascript/#comment-8469</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Sat, 21 Nov 2009 02:31:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.randomsnippets.com/2008/03/05/simulate-a-button-click-via-javascript/#comment-8469</guid>
		<description>This is great and halfway to what I need. I actually want to simulate a button push when a certain key is pressed. 
What I have is a web page that shows video clips. I have  "prev" and "next" buttons. Sometimes the buttons are (intentionally) off the visible page. What I want to do is capture keys to simulate a button click. The button push actually results in the page being reloaded with the prev/next video clip. So I'm not using checkboxes just a plain old key capture. The way it works is that once the page is loaded if I click anywhere on the page (document)it gives it focus and then when I click the appropriate key (P/N) it does what I would expect. However because it reloads the page I lose focus and so have to click on the page again. (Yeah probably bad design in the first place but it is what it is at this point.) So I tried to get around this by something like  or  but it doesn't seem to work. So my question is how do I set focus on the document itself after it loads? (Oh and this is a page within a frameset to boot. :-) )</description>
		<content:encoded><![CDATA[<p>This is great and halfway to what I need. I actually want to simulate a button push when a certain key is pressed.<br />
What I have is a web page that shows video clips. I have  &#8220;prev&#8221; and &#8220;next&#8221; buttons. Sometimes the buttons are (intentionally) off the visible page. What I want to do is capture keys to simulate a button click. The button push actually results in the page being reloaded with the prev/next video clip. So I&#8217;m not using checkboxes just a plain old key capture. The way it works is that once the page is loaded if I click anywhere on the page (document)it gives it focus and then when I click the appropriate key (P/N) it does what I would expect. However because it reloads the page I lose focus and so have to click on the page again. (Yeah probably bad design in the first place but it is what it is at this point.) So I tried to get around this by something like  or  but it doesn&#8217;t seem to work. So my question is how do I set focus on the document itself after it loads? (Oh and this is a page within a frameset to boot. :-) )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alan</title>
		<link>http://www.randomsnippets.com/2008/03/05/simulate-a-button-click-via-javascript/#comment-8012</link>
		<dc:creator>Alan</dc:creator>
		<pubDate>Fri, 06 Nov 2009 15:54:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.randomsnippets.com/2008/03/05/simulate-a-button-click-via-javascript/#comment-8012</guid>
		<description>Also it is possible this elegant simulation:


&lt;a href="document.getElementById('fil').click();" rel="nofollow"&gt;Play a song!&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Also it is possible this elegant simulation:</p>
<p><a href="document.getElementById('fil').click();" rel="nofollow">Play a song!</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vince</title>
		<link>http://www.randomsnippets.com/2008/03/05/simulate-a-button-click-via-javascript/#comment-7462</link>
		<dc:creator>Vince</dc:creator>
		<pubDate>Fri, 16 Oct 2009 19:58:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.randomsnippets.com/2008/03/05/simulate-a-button-click-via-javascript/#comment-7462</guid>
		<description>What if you have an  control and you are trying to simulate the click event? I'm trying to fire a server-side event that's why i need the asp:button.

You can't use getElementById("Button_ID") right? Do you need the ClientID?

Thanks...</description>
		<content:encoded><![CDATA[<p>What if you have an  control and you are trying to simulate the click event? I&#8217;m trying to fire a server-side event that&#8217;s why i need the asp:button.</p>
<p>You can&#8217;t use getElementById(&#8221;Button_ID&#8221;) right? Do you need the ClientID?</p>
<p>Thanks&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wellsantos</title>
		<link>http://www.randomsnippets.com/2008/03/05/simulate-a-button-click-via-javascript/#comment-5994</link>
		<dc:creator>wellsantos</dc:creator>
		<pubDate>Thu, 20 Aug 2009 12:53:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.randomsnippets.com/2008/03/05/simulate-a-button-click-via-javascript/#comment-5994</guid>
		<description>Hi, I'm looking for something like this:

  function fireEvent (x, y, type) {...}

Does somebody know's any function like above?
Because I need to simulate an event at X,Y with the mouse.

  Example: fireEvent( 100, 50, "mousedown" );

Thanks.</description>
		<content:encoded><![CDATA[<p>Hi, I&#8217;m looking for something like this:</p>
<p>  function fireEvent (x, y, type) {&#8230;}</p>
<p>Does somebody know&#8217;s any function like above?<br />
Because I need to simulate an event at X,Y with the mouse.</p>
<p>  Example: fireEvent( 100, 50, &#8220;mousedown&#8221; );</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Miguel Céspedes</title>
		<link>http://www.randomsnippets.com/2008/03/05/simulate-a-button-click-via-javascript/#comment-5603</link>
		<dc:creator>Miguel Céspedes</dc:creator>
		<pubDate>Wed, 05 Aug 2009 22:25:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.randomsnippets.com/2008/03/05/simulate-a-button-click-via-javascript/#comment-5603</guid>
		<description>The link contains attributes:
&lt;strong&gt;&#60;a href=&#34;http://iaian7.com/media/2007/06/2007vfx.flv&#34; rel=&#34;mediabox[640 360]&#34; title=&#34;flash video&#34;&#62;play flash video &#187;&#60;/a&#62;&lt;/strong&gt;</description>
		<content:encoded><![CDATA[<p>The link contains attributes:<br />
<strong>&lt;a href=&quot;http://iaian7.com/media/2007/06/2007vfx.flv&quot; rel=&quot;mediabox[640 360]&quot; title=&quot;flash video&quot;&gt;play flash video &raquo;&lt;/a&gt;</strong></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Miguel Céspedes</title>
		<link>http://www.randomsnippets.com/2008/03/05/simulate-a-button-click-via-javascript/#comment-5602</link>
		<dc:creator>Miguel Céspedes</dc:creator>
		<pubDate>Wed, 05 Aug 2009 22:14:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.randomsnippets.com/2008/03/05/simulate-a-button-click-via-javascript/#comment-5602</guid>
		<description>Thanks but not is what I'm looking for.
I want to call "Mediabox" from a button

This is the link:

&lt;a href="http://iaian7.com/media/2007/06/2007vfx.flv" title="flash video" rel="nofollow"&gt;play flash video »&lt;/a&gt;

And this is the library:
http://iaian7.com/webcode/Mediabox</description>
		<content:encoded><![CDATA[<p>Thanks but not is what I&#8217;m looking for.<br />
I want to call &#8220;Mediabox&#8221; from a button</p>
<p>This is the link:</p>
<p><a href="http://iaian7.com/media/2007/06/2007vfx.flv" title="flash video" rel="nofollow">play flash video »</a></p>
<p>And this is the library:<br />
<a href="http://iaian7.com/webcode/Mediabox" rel="nofollow">http://iaian7.com/webcode/Mediabox</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Knix</title>
		<link>http://www.randomsnippets.com/2008/03/05/simulate-a-button-click-via-javascript/#comment-5599</link>
		<dc:creator>Knix</dc:creator>
		<pubDate>Wed, 05 Aug 2009 21:17:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.randomsnippets.com/2008/03/05/simulate-a-button-click-via-javascript/#comment-5599</guid>
		<description>Yes, it should work!

http://www.webmasterworld.com/forum91/762.htm</description>
		<content:encoded><![CDATA[<p>Yes, it should work!</p>
<p><a href="http://www.webmasterworld.com/forum91/762.htm" rel="nofollow">http://www.webmasterworld.com/forum91/762.htm</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Miguel Céspedes</title>
		<link>http://www.randomsnippets.com/2008/03/05/simulate-a-button-click-via-javascript/#comment-5598</link>
		<dc:creator>Miguel Céspedes</dc:creator>
		<pubDate>Wed, 05 Aug 2009 21:05:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.randomsnippets.com/2008/03/05/simulate-a-button-click-via-javascript/#comment-5598</guid>
		<description>Can you replace the button with a hyperlink?</description>
		<content:encoded><![CDATA[<p>Can you replace the button with a hyperlink?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Knix</title>
		<link>http://www.randomsnippets.com/2008/03/05/simulate-a-button-click-via-javascript/#comment-278</link>
		<dc:creator>Knix</dc:creator>
		<pubDate>Thu, 28 Aug 2008 14:05:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.randomsnippets.com/2008/03/05/simulate-a-button-click-via-javascript/#comment-278</guid>
		<description>Hi Henrique,

Yes, you can try the following instead:
&lt;pre lang="html"&gt;
&lt;a href="javascript:myJavaScriptFunction();" rel="nofollow"&gt;Click Me&lt;/a&gt;
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Hi Henrique,</p>
<p>Yes, you can try the following instead:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;a href=&quot;javascript:myJavaScriptFunction();&quot; rel=&quot;nofollow&quot;&gt;Click Me&lt;/a&gt;</pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Henrique</title>
		<link>http://www.randomsnippets.com/2008/03/05/simulate-a-button-click-via-javascript/#comment-277</link>
		<dc:creator>Henrique</dc:creator>
		<pubDate>Thu, 28 Aug 2008 13:12:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.randomsnippets.com/2008/03/05/simulate-a-button-click-via-javascript/#comment-277</guid>
		<description>Very Nice!
But do you know how to set this kind of click on a link object with HREF instead ONCLICK?
Thanks.</description>
		<content:encoded><![CDATA[<p>Very Nice!<br />
But do you know how to set this kind of click on a link object with HREF instead ONCLICK?<br />
Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sunil</title>
		<link>http://www.randomsnippets.com/2008/03/05/simulate-a-button-click-via-javascript/#comment-125</link>
		<dc:creator>sunil</dc:creator>
		<pubDate>Wed, 02 Jul 2008 15:47:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.randomsnippets.com/2008/03/05/simulate-a-button-click-via-javascript/#comment-125</guid>
		<description>Neat!</description>
		<content:encoded><![CDATA[<p>Neat!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scanmen</title>
		<link>http://www.randomsnippets.com/2008/03/05/simulate-a-button-click-via-javascript/#comment-42</link>
		<dc:creator>Scanmen</dc:creator>
		<pubDate>Tue, 22 Apr 2008 08:36:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.randomsnippets.com/2008/03/05/simulate-a-button-click-via-javascript/#comment-42</guid>
		<description>Nice code ... thanks</description>
		<content:encoded><![CDATA[<p>Nice code &#8230; thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: arab</title>
		<link>http://www.randomsnippets.com/2008/03/05/simulate-a-button-click-via-javascript/#comment-11</link>
		<dc:creator>arab</dc:creator>
		<pubDate>Tue, 25 Mar 2008 15:24:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.randomsnippets.com/2008/03/05/simulate-a-button-click-via-javascript/#comment-11</guid>
		<description>its nice ...thanx a lot</description>
		<content:encoded><![CDATA[<p>its nice &#8230;thanx a lot</p>
]]></content:encoded>
	</item>
</channel>
</rss>
