Need help in HTML input tag sorting

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RajasScripts
    New Member
    • May 2007
    • 2

    #1

    Need help in HTML input tag sorting

    Hi
    I need some guidance in sorting HTML input tag sorting.I am able to sort columns with out input tag and with dates.But the only problem is I am not able to sort a column which is text box with Numbers.I am using sorttable.js file which i got from website. This one is working fine with all the column but not with input tag (I mean text box where user enter Numerical value)

    Regards
    Raja
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Heya, RajasScripts. Welcome to TSDN!

    Originally posted by RajasScripts
    I am using sorttable.js file which i got from website.
    Are you talking about this:


    Originally posted by RajasScripts
    I am able to sort columns with out input tag and with dates. But the only problem is I am not able to sort a column which is text box with Numbers.
    Post some code, and let's look it over.

    Comment

    • RajasScripts
      New Member
      • May 2007
      • 2

      #3
      Thanks for the reply
      I have added code in this......
      Originally posted by pbmods
      Heya, RajasScripts. Welcome to TSDN!



      Are you talking about this:


      yes I am talking about this sorttable.js file




      Post some code, and let's look it over.
      Code:

      [CODE=jsp]<%
      try
      {
      Strng [] name = new {"abc","bca","c ba"};
      Strng [] contrl = new {"c1","a1","b1" };
      Strng [] add = new {"z","a","b" };

      %>


      <HTML>
      <HEAD>
      <TITLE>PRS3 - Account Entry</TITLE>
      </HEAD>
      <SCRIPT LANGUAGE="JavaS cript" SRC="sorttable. js"></SCRIPT>

      <BODY BGCOLOR="#FFFFF F" LINK="#660099" ALINK="#660099" VLINK="#660099" TOPMARGIN="0" LEFTMARGIN="0" RIGHTMARGIN="0" MARGINHEIGHT="0 " MARGINWIDTH="0" >


      <TABLE borderColor="#1 11111" height="50" cellSpacing="1" width="1000" border="0" cellpadding="0" valign="top" bgcolor="#44444 4" class='sortable '>
      <THEAD>
      <TR bgColor="cccccc ">
      <th width="29" height="43">&nb sp;&nbsp;</th>

      <th width="130" height="43" style="border-style: none; border-width: medium; ">
      <b><font size="2" face="Arial, Helvetica, sans-serif"><div align="center"> Number Name</font></b></div>
      </th>
      <th width="154" height="43" style="border-style: none; border-width: medium; ">
      <b><font face="Arial, Helvetica, sans-serif" size="2"><div align="center"> Corporate/Control Codes</font></b></div>
      </th>
      <th width="127" height="43" style="border-style: none; border-width: medium; ">
      <b><font face="Arial, Helvetica, sans-serif" size="2"><div align="center"> Address</font></b></div>
      </th>

      <th width="200" height="43" align="center">
      <b><font face="Arial, Helvetica, sans-serif" size="2"><div align="center"> Problem with this Col </font>
      </b></div>
      </th>
      </tr>
      </THEAD>
      <TBODY>
      <% //for(int i=0;i<3;i++)
      {

      %>
      <tr bgcolor="#FFFFF F">
      <td width="29" height="43">
      <%


      %>
      <input type="checkbox" name="checkedVa lues" value="">
      <%

      %>
      &nbsp;&nbsp; </td>

      <td width="154" height="43" style="border-style: none; border-width: medium; ">
      <FONT face="Arial, Helvetica, sans-serif" size="2">abc</font>
      </td>
      <td width="127" height="43" style="border-style: none; border-width: medium; ">
      <FONT face="Arial, Helvetica, sans-serif" size="2">c2<br> </font>
      </td>
      <td width="127" height="43" style="border-style: none; border-width: medium; ">
      <FONT face="Arial, Helvetica, sans-serif" size="2">a3<br> </font>
      </td>


      <td height="43">$ &nbsp;<input type="text" name="incrAGR" size="12" maxlength="12"> </td>

      </tr>
      <% }
      {

      %>
      <tr bgcolor="#FFFFF F">
      <td width="29" height="43">
      <%


      %>
      <input type="checkbox" name="checkedVa lues" value="">
      <%

      %>
      &nbsp;&nbsp; </td>

      <td width="154" height="43" style="border-style: none; border-width: medium; ">
      <FONT face="Arial, Helvetica, sans-serif" size="2">bca</font>
      </td>
      <td width="127" height="43" style="border-style: none; border-width: medium; ">
      <FONT face="Arial, Helvetica, sans-serif" size="2">c3<br> </font>
      </td>
      <td width="127" height="43" style="border-style: none; border-width: medium; ">
      <FONT face="Arial, Helvetica, sans-serif" size="2">a1<br> </font>
      </td>


      <td height="43">$ &nbsp;<input type="text" name="incrAGR" size="12" maxlength="12"> </td>

      </tr>
      <% }
      {

      %>
      <tr bgcolor="#FFFFF F">
      <td width="29" height="43">
      <%


      %>
      <input type="checkbox" name="checkedVa lues" value="">
      <%

      %>
      &nbsp;&nbsp; </td>

      <td width="154" height="43" style="border-style: none; border-width: medium; ">
      <FONT face="Arial, Helvetica, sans-serif" size="2">cba</font>
      </td>
      <td width="127" height="43" style="border-style: none; border-width: medium; ">
      <FONT face="Arial, Helvetica, sans-serif" size="2">c1<br> </font>
      </td>
      <td width="127" height="43" style="border-style: none; border-width: medium; ">
      <FONT face="Arial, Helvetica, sans-serif" size="2">a2<br> </font>
      </td>


      <td height="43">$ &nbsp;<input type="text" name="incrAGR" size="12" maxlength="12"> </td>

      </tr>
      <% }
      {

      %>
      <tr bgcolor="#FFFFF F">
      <td width="29" height="43">
      <%


      %>
      <input type="checkbox" name="checkedVa lues" value="">
      <%

      %>
      &nbsp;&nbsp; </td>

      <td width="154" height="43" style="border-style: none; border-width: medium; ">
      <FONT face="Arial, Helvetica, sans-serif" size="2">zx</font>
      </td>
      <td width="127" height="43" style="border-style: none; border-width: medium; ">
      <FONT face="Arial, Helvetica, sans-serif" size="2">c4<br> </font>
      </td>
      <td width="127" height="43" style="border-style: none; border-width: medium; ">
      <FONT face="Arial, Helvetica, sans-serif" size="2">a6<br> </font>
      </td>


      <td height="43">$ &nbsp;<input type="text" name="incrAGR" size="12" maxlength="12"> </td>

      </tr>
      <% }

      %> </TBODY>
      </TABLE>

      </TABLE>
      </FORM>
      </BODY>
      </HTML>
      <%
      }
      }catch(Exceptio n t){
      //out.println(t.g etMessage());


      }
      %>[/CODE]
      Please post code in tags - MODERATOR
      Last edited by acoder; May 18 '07, 10:33 AM. Reason: Code in tags

      Comment

      Working...