<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>TechieDan &#187; javascript</title>
	<atom:link href="http://techiedan.com/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://techiedan.com</link>
	<description>Your Search for The Tech Stuffs</description>
	<lastBuildDate>Tue, 22 May 2012 08:10:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Javascript Submit Form Not Working</title>
		<link>http://techiedan.com/2009/11/26/javascript-submit-form-not-working/</link>
		<comments>http://techiedan.com/2009/11/26/javascript-submit-form-not-working/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 06:46:00 +0000</pubDate>
		<dc:creator>techieDan</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[submit]]></category>

		<guid isPermaLink="false">http://techiedan.com/?p=676</guid>
		<description><![CDATA[<p>Remember previously I was writing about how to do javascript to submit a form in html/jsp/php/asp. Well, surprisingly sometimes we discover things which are unexpected. For instance to submit a form without clicking the submit button but another link or button. Though something is wrong! The form doesn&#8217;t submit at all and there&#8217;s a javascript [...]]]></description>
			<content:encoded><![CDATA[<p>Remember previously I was writing about how to do javascript to submit a form in html/jsp/php/asp. Well, surprisingly sometimes we discover things which are unexpected. For instance to submit a form without clicking the submit button but another link or button. Though something is wrong! The form doesn&#8217;t submit at all and there&#8217;s a javascript error too.</p>
<input type="button" value="Send Data" />
<input type="submit" value="Original Submit" />
<p>From the example above, imagine clicking the <strong>Send Data button</strong> to submit the form using javascript. (<em>Well, the above is just an example and doesn&#8217;t do a thing though). </em>The issue is what&#8217;s the matter? Here are the solutions.</p>
<p><img class="alignnone size-full wp-image-687" title="Submit Form" src="http://techiedan.com/wp-content/uploads/2009/11/submitform.jpg" alt="Submit Form" width="424" height="283" /></p>
<p>If you have a submit button visible in your form, do rename your Submit button. For example</p>
<pre>&lt;input type="Submit" name="submit" value="submit"&gt;</pre>
<p>should be renamed to something like</p>
<pre>&lt;input type="Submit" name="SendForm" value="submit"&gt;</pre>
<p>Notice the difference? The name is change in the property of the input type. Now how do you explain this phenomena?</p>
<blockquote><p><em>This is a naming issue. forms have a method called &#8216;submit&#8217;, but if you give a form element the name &#8216;submit&#8217; then javascript will not be able to find the .submit method, causing your .submit function to never fire.</em></p></blockquote>
<p>Finally all is well once again. If you&#8217;re still clueless as to how to create a form using buttons and submitting it via javascript, remember to <a title="Submit Form Using Button" href="http://techiedan.com/2009/01/18/use-button-instead-of-submit-for-form/" target="_blank">visit this post to learn all about it</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://techiedan.com/2009/11/26/javascript-submit-form-not-working/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use Button Instead of Submit for Form</title>
		<link>http://techiedan.com/2009/01/18/use-button-instead-of-submit-for-form/</link>
		<comments>http://techiedan.com/2009/01/18/use-button-instead-of-submit-for-form/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 16:52:42 +0000</pubDate>
		<dc:creator>techieDan</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://techiedan.com/?p=257</guid>
		<description><![CDATA[Disable the automatic enter key that people tend to associate with forms. Well, it's good at the same time, but it's also sometimes good that you can limit your users from using the Enter key to submit the form if you want to do something else with it.]]></description>
			<content:encoded><![CDATA[<p>For those in the programming area, if you&#8217;re doing simple form processing of your HTML, why some people prefer buttons over submit.</p>
<p>Well for my personal preference, one of the good thing is that I can disable the automatic enter key that people tend to associate with forms. Well, it&#8217;s good at the same time, but it&#8217;s also sometimes good that you can limit your users from using the Enter key to submit the form if you want to do something else with it.</p>
<p>Getting a bit confusing, well, what is important is that by using buttons, I can forced the user to enable javascript in order to submit. Here&#8217;s how I do it.</p>
<pre style="background-color:#aaaacc">&lt;form name="form1" method="post" action="somepage" &gt;
&lt;input type='text' name='name' /&gt;
&lt;input type='button' value='Submit This Name' <strong><span style="color: #ff0000;">
onClick='submitForm(this.form1);</span></strong>'&gt;
&lt;/form&gt;</pre>
<p>Now if the user disables javascript, they won&#8217;t be able to process the form unless they are smart enough to change it, which most programmers and IT techies know. But this is just a small deterrent. Here&#8217;s the javascript part.</p>
<pre style="background-color:#aaaacc">&lt;script language="javascript"&gt;
function submitForm(thisform) {
thisform.submit();
}
&lt;/script&gt;</pre>
<p>There are lots of ways out there to force javascript control to be enabled on the form. But this is just the simplest of it all.</p>
]]></content:encoded>
			<wfw:commentRss>http://techiedan.com/2009/01/18/use-button-instead-of-submit-for-form/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How To Create An Annoying Site</title>
		<link>http://techiedan.com/2008/12/07/how-to-create-an-annoying-site/</link>
		<comments>http://techiedan.com/2008/12/07/how-to-create-an-annoying-site/#comments</comments>
		<pubDate>Sun, 07 Dec 2008 10:27:37 +0000</pubDate>
		<dc:creator>techieDan</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://techiedan.com/?p=216</guid>
		<description><![CDATA[<p>This is a small part of where someone who isn&#8217;t IT savvy but just want to poke some fun ass onto his friends with his annoying websites.</p>
<p>Well, what I meant was have you ever been sent a site where there are popups like Welcome to My Site! Now you can do that too. All you [...]]]></description>
			<content:encoded><![CDATA[<p>This is a small part of where someone who isn&#8217;t IT savvy but just want to poke some fun ass onto his friends with his annoying websites.</p>
<p>Well, what I meant was have you ever been sent a site where there are popups like Welcome to My Site! Now you can do that too. All you need is to enter this into your page html.</p>
<blockquote style="background-color:#AAFFDD"><p>&lt;script language=&#8221;javascript&#8221;&gt;<br />
alert(&#8220;You are now in my site!&#8221;);<br />
alert(&#8220;Hahaha!! I have complete control over your clicking!! You can&#8217;t do anything except click me!&#8221;);<br />
alert(&#8220;The problem is you have to go thru all this pop up to get the sexy photos later!&#8221;);<br />
alert(&#8220;&#8230;.&#8221;);<br />
&lt;!&#8211; and on on on on and on and on&#8230;&#8230;. &#8211;&gt;<br />
&lt;/script&gt;</p></blockquote>
<p>Yes, though let me tell you something. If you were to do this to all your links. Be prepare to lose some visitors. Of course with a bit of customization, you can actually set it to display this things when people redirect from a certain site. How to do this next step though? That will come in another time.</p>
<p>If you still have trouble with the script above and still ain&#8217;t sure where to insert it, you may drop a message in this post.</p>
]]></content:encoded>
			<wfw:commentRss>http://techiedan.com/2008/12/07/how-to-create-an-annoying-site/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Button Javascript in WordPress</title>
		<link>http://techiedan.com/2008/06/14/button-javascript-in-wordpress/</link>
		<comments>http://techiedan.com/2008/06/14/button-javascript-in-wordpress/#comments</comments>
		<pubDate>Sat, 14 Jun 2008 12:22:50 +0000</pubDate>
		<dc:creator>techieDan</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[button]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://techiedan.com/?p=102</guid>
		<description><![CDATA[<p>Previously I wrote about <a href="http://techiedan.com/2008/06/05/simple-javascript-hello-world/">how to write a simple javascript button for normal webpages</a>. But it looks like it&#8217;s utterly different for creating a button in WordPress. Well, basically there&#8217;s a way to write it. With that too, you can actually have a lot of other things like a statistics counter to count how [...]]]></description>
			<content:encoded><![CDATA[<p>Previously I wrote about <a href="http://techiedan.com/2008/06/05/simple-javascript-hello-world/">how to write a simple javascript button for normal webpages</a>. But it looks like it&#8217;s utterly different for creating a button in WordPress. Well, basically there&#8217;s a way to write it. With that too, you can actually have a lot of other things like a statistics counter to count how many times a user has clicked. Well, depends on how well you know though.</p>
<p><button onclick="javascript:alert('Hello!\nWelcome to TechieDan.com')">CLICK ME</button></p>
<p>How did I create this button on WordPress? SIMPLE!!</p>
<pre style="background-color:cyan">&lt;button onclick="javascript:alert('Hello!\nWelcome to TechieDan.com')"&gt;
CLICK ME&lt;/button&gt;</pre>
<p>Straightforward, so have some fun with Javascript Buttons on WordPress.</p>
]]></content:encoded>
			<wfw:commentRss>http://techiedan.com/2008/06/14/button-javascript-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Javascript Hello World</title>
		<link>http://techiedan.com/2008/06/05/simple-javascript-hello-world/</link>
		<comments>http://techiedan.com/2008/06/05/simple-javascript-hello-world/#comments</comments>
		<pubDate>Thu, 05 Jun 2008 04:30:13 +0000</pubDate>
		<dc:creator>techieDan</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://techiedan.com/?p=97</guid>
		<description><![CDATA[<p>Here&#8217;s a simple script that every new javascript scripters should know. Well, play with buttons and poof&#8230;. javascript. Well, although writing it in WordPress is a whole lot different from normal javascripting.</p>
<p>Hello World</p>
<p>Impressive? Well, in normal html codes it would be</p>
&#60;input type='button' value='Hello World'
onClick='javascript:alert('Hello!\nWelcome to TechieDan.com')'&#62;
<p>Cool right  </p>
]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a simple script that every new javascript scripters should know. Well, play with buttons and poof&#8230;. javascript. Well, although writing it in WordPress is a whole lot different from normal javascripting.</p>
<p><button onclick="javascript:alert('Hello!\nWelcome to TechieDan.com')">Hello World</button></p>
<p>Impressive? Well, in normal html codes it would be</p>
<pre style="background-color:cyan">&lt;input type='button' value='Hello World'
onClick='javascript:alert('Hello!\nWelcome to TechieDan.com')'&gt;</pre>
<p>Cool right <img src='http://techiedan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://techiedan.com/2008/06/05/simple-javascript-hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript Simple Call Form</title>
		<link>http://techiedan.com/2008/03/25/javascript-simple-call-form/</link>
		<comments>http://techiedan.com/2008/03/25/javascript-simple-call-form/#comments</comments>
		<pubDate>Tue, 25 Mar 2008 01:56:37 +0000</pubDate>
		<dc:creator>techieDan</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[html form]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://techiedan.com/2008/03/25/javascript-simple-call-form/</guid>
		<description><![CDATA[<p>Javascript isn&#8217;t that hard. Especially when you want to handle a simple form action. For example, most sites tells us how to do validation for regular expressions and the javascript for it, but what if one is a totally newbie to javascript and html.</p>
<p>Here I bring upon you some of my practices which somehow though, [...]]]></description>
			<content:encoded><![CDATA[<p>Javascript isn&#8217;t that hard. Especially when you want to handle a simple form action. For example, most sites tells us how to do validation for regular expressions and the javascript for it, but what if one is a totally newbie to javascript and html.</p>
<p>Here I bring upon you some of my practices which somehow though, not as new as the new javascript version and standard, it still works.</p>
<blockquote style="background-color: #fdf5e6"><p><em>&lt;form name=&#8217;testForm&#8217; method=&#8217;post&#8217; action=&#8217;callAction.jsp&#8217;&gt;<br />
&lt;table&gt;<br />
 &lt;tr&gt;<br />
  &lt;td&gt;Username&lt;/td&gt;<br />
  &lt;td&gt;: &lt;input type=&#8217;text&#8217; name=&#8217;username&#8217; value=&#8221;&gt;&lt;/td&gt;<br />
 &lt;/tr&gt;<br />
 &lt;tr&gt;<br />
  &lt;td colspan=2&gt;&lt;input type=&#8217;button&#8217; value=&#8217;submit&#8217; <span style="color: blue">onClick=&#8217;submitForm(this.form);&#8217;</span>&gt;&lt;/td&gt;<br />
 &lt;/tr&gt;<br />
&lt;/table&gt; <br />
&lt;/form&gt;</em></p></blockquote>
<p>Now the above is a sample form. Now how about the javascript. Yes, as can be seen the onClick function is by itself a javascript to call a method from javascript. Now what can be done. Seeing from here, the reason instead of using a submit button, an INPUT TYPE=&#8217;button&#8217; is being used, so it&#8217;ll be easier to handle actions using javascript.</p>
<p>Now have a look at the javascript method that was called. Let&#8217;s say to submit this form and to display the alert of the username.</p>
<blockquote style="background-color: #fdf5e6"><p><em>&lt;script language=&#8217;javascript&#8217;&gt;<br />
   function submitForm(thisform) {<br />
        alert(&#8220;You have submitted &#8221; + thisform.username.value +<br />
                &#8221; as your username!&#8221;);<br />
        thisform.submit();<br />
   }<br />
&lt;/script&gt;</em></p></blockquote>
<p>So this function is mighty straight forward. It&#8217;ll display the username as well as submit the form to wherever it was submitted to. In this case, the form is submitted to itself.</p>
<p>So there you have it. <img src='http://techiedan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://techiedan.com/2008/03/25/javascript-simple-call-form/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

