<jQueryReady>

The jQueryReady tag is a quick and easy way to embed a jQuery "ready" event in the page. This tag requires jQuery be included in the page.

Syntax

<jQueryReady>   
  [jQuery and/or Javascript script]
</jQueryReady>

Remarks

Back to top

Example

In the example below, added a "help" image and some help text just after the ListBox. We've set the help SPAN tag containing the help text to initially be hidden (style="display:none;"). Then, we used the jQueryReady tag to attach some code to the image tag's click event. It simply makes the help SPAN tag visible.

<AddForm>
  ...
  <table>
    <tr>
       <td>
        <label for="txtFirstName" text="First Name" />
        <textbox id="txtFirstName" datafield="FirstName" datatype="string" />
      </td>
    </tr>
    <tr>
      <td>
        <label for="lstColors" text="Favorite Color" />
<listbox id="lstColors" datafield="FavoriteColors" datatype="string" selectionmode="single">
          <listitem value="#00FF00">Green</listitem>
          <listitem value="#FF0000" selected="true">Red</listitem>
          <listitem value="#0000FF">Blue</listitem>
         </listbox>
         <img src="/images/help_icon.gif" class="help-icon" />
         <span class="help-text" style="display:none;">Choose your absolute favorite color</span>
      </td>
    </tr>
    <tr>
      <td colspan="2">
        <addbutton text="Add"/> <cancelbutton text="Cancel"/>
      </td>
    </tr>
  </table>
  <jQueryReady>

    $("img.help-icon").click(function(){
      $(this).next().show();
    });
  </jQueryReady>
</AddForm>

 
Back to top