Archive for the 'Javascript' Category

Submit a Form in Internet Explorer with Enter

Ran into an (other) interesting Internet Explorer bug. Seems that if you have a form with only a single text input, hitting the enter button will not submit the form in IE. <form action="" method="post"> <fieldset> <label for="user_name">User Name</label> [...]

Share and Enjoy:
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • LinkedIn
  • Live
  • RSS
17 November 2009 at 04:04 - Comments

Executing JavaScript on page load

Following code helps you to define any JS function to be called on page load. The tricky part of the code is that it waits until page is completely loaded.

<script> function init() { [...]

Share and Enjoy:
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • LinkedIn
  • Live
  • RSS
4 November 2009 at 08:07 - Comments

Javascript HtmlEncode/HtmlDecode

Ack:- Lunar Media Have you ever needed to HtmlEncode a querystring using JavaScript? Yes you may say, and several people will claim that you should UrlEncode it using escape(str); For some unknown reason I tried doing exactly that and UrlDecode the variable in csharp with no luck. Instead I found a solution in the Prototype library, [...]

Share and Enjoy:
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • LinkedIn
  • Live
  • RSS
15 June 2007 at 14:08 - Comments

Direct Population of Form Values using Javascript

Type the following code in Address bar to fill the form fields named Ad1 and Ad2 wth certain text. javascript:function A(){document.getElementById(‘Ad1′).value =”sadAS1″;document.getElementById(‘Ad2′).value = “sadAS2″;}setTimeout(‘A()’); void(0)

Share and Enjoy:

Share and Enjoy:
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • LinkedIn
  • Live
  • RSS
9 March 2007 at 14:21 - Comments