<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: javascript code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Fri, 08 Aug 2008 20:34:39 GMT</pubDate>
    <description>DZone Snippets: javascript code</description>
    <item>
      <title>Stopping double submits</title>
      <link>http://snippets.dzone.com/posts/show/5628</link>
      <description>&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;        Dim sb As New System.Text.StringBuilder()&lt;br /&gt;        sb.Append("if (typeof(Page_ClientValidate) == 'function') { ")&lt;br /&gt;        sb.Append("if (Page_ClientValidate() == false) { return false; }} ")&lt;br /&gt;        sb.Append("this.value = 'Please Wait...';")&lt;br /&gt;        sb.Append("this.disabled = true;")&lt;br /&gt;        sb.Append(Me.Page.GetPostBackEventReference(Me.btnSubmit))&lt;br /&gt;        sb.Append(";")&lt;br /&gt;        btnSubmit.Attributes.Add("onclick", sb.ToString())&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 10 Jun 2008 20:02:48 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5628</guid>
      <author>mwgriffith (Michael Griffith)</author>
    </item>
    <item>
      <title>Setting focus to a field in asp.net</title>
      <link>http://snippets.dzone.com/posts/show/5592</link>
      <description>This code does a simple field focus in asp.net.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;    Protected Sub setFieldFocus(ByVal ctrl As System.Web.UI.Control)&lt;br /&gt;        Dim s As String = "&lt;SCRIPT language='javascript'&gt;document.getElementById('" + ctrl.ClientID + "').focus() &lt;/SCRIPT&gt;"&lt;br /&gt;        ClientScript.RegisterStartupScript(Me.GetType, "focus", s)&lt;br /&gt;    End Sub&lt;br /&gt;&lt;br /&gt;     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load&lt;br /&gt;        If Not Page.IsPostBack Then&lt;br /&gt;            BindData()&lt;br /&gt;        End If&lt;br /&gt;        setFieldFocus(txtSpecies)&lt;br /&gt;    End Sub&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 05 Jun 2008 15:29:49 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5592</guid>
      <author>mwgriffith (Michael Griffith)</author>
    </item>
    <item>
      <title>Gathering html id's from asp.net</title>
      <link>http://snippets.dzone.com/posts/show/4974</link>
      <description>The basic idea here is to pull the id's from asp.net so that it can be used in a javascript environment.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;input id="GetLocation" type="button" onclick="getLocation(&lt;%=tbStreet.clientID %&gt;.value + ' ' + &lt;%=tbCity.clientID %&gt;.value + ' ' + &lt;%=tbState.clientID %&gt;.value + ' ' + &lt;%=tbZip.clientID %&gt;.value,'&lt;%=lblLocation.clientID %&gt;');" value="Get Location" /&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Fri, 11 Jan 2008 16:28:38 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4974</guid>
      <author>mwgriffith (Michael Griffith)</author>
    </item>
  </channel>
</rss>
