if there is any way to make visible and keydown event in html text box and combo?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nirmalsingh
    New Member
    • Sep 2006
    • 218

    if there is any way to make visible and keydown event in html text box and combo?

    i am usinjg ajax technology with c# code behind. i have created html table using c# just like
    Response.Write( "<table>");
    ....
    ....
    ....
    Response.Write( "</table>");

    i want to display text box inside table cell only at when i click the cell of a table,
    and after i type some text and if press enter key, the curent text box in the cell need to be invisible and combo box in next cell should be visibled. and the typed data in text box should be placed in particular cell. atlast i want to read all the data from from table and store in database. help me with sample code plz..
  • radcaesar
    Recognized Expert Contributor
    • Sep 2006
    • 759

    #2
    You have to achieve this using JavaScript.

    use document.formna me.textbaxname to access the particular controls in the form and use the events of that control to hide and get values.

    :)


    Originally posted by nirmalsingh
    i am usinjg ajax technology with c# code behind. i have created html table using c# just like
    Response.Write( "<table>");
    ....
    ....
    ....
    Response.Write( "</table>");

    i want to display text box inside table cell only at when i click the cell of a table,
    and after i type some text and if press enter key, the curent text box in the cell need to be invisible and combo box in next cell should be visibled. and the typed data in text box should be placed in particular cell. atlast i want to read all the data from from table and store in database. help me with sample code plz..

    Comment

    • AricC
      Recognized Expert Top Contributor
      • Oct 2006
      • 1885

      #3
      Originally posted by nirmalsingh
      i am usinjg ajax technology with c# code behind. i have created html table using c# just like
      Response.Write( "<table>");
      ....
      ....
      ....
      Response.Write( "</table>");

      i want to display text box inside table cell only at when i click the cell of a table,
      and after i type some text and if press enter key, the curent text box in the cell need to be invisible and combo box in next cell should be visibled. and the typed data in text box should be placed in particular cell. atlast i want to read all the data from from table and store in database. help me with sample code plz..
      What code do you have already? Please post what you have so people can make changes.

      Aric

      Comment

      • nirmalsingh
        New Member
        • Sep 2006
        • 218

        #4
        private void loadTable()
        {
        string strAlpha=Reques t.QueryString["alpha"];//get the alphabets
        int intPageValue=Co nvert.ToInt16(R equest.QueryStr ing["Pager"]);//get the page value
        string[] strDetails;
        string strData;
        int i;
        int intRowCount;
        //get the data from database
        if (strAlpha==null || strAlpha == "ALL")
        {
        strData=iGenera l.RetrieveRecor ds("b.bank_code ,b.bank_name,b. address1,b.addr ess2,c.city_nam e,b.zip_code,s. state_name,b.co untry,b.phone1, b.phone2,b.cont act_person,b.fa x1,b.fax2,b.ema il,b.website"," city_master c,bank_master b,state_master s","b.city_code =c.city_code and b.state_code=s. state_code");

        }
        else
        {
        strData=iGenera l.RetrieveRecor ds("b.bank_code ,b.bank_name,b. address1,b.addr ess2,c.city_nam e,b.zip_code,s. state_name,b.co untry,b.phone1, b.phone2,b.cont act_person,b.fa x1,b.fax2,b.ema il,b.website"," city_master c,bank_master b,state_master s","b.city_code =c.city_code and b.state_code=s. state_code and b.bank_name like '" + strAlpha + "%'");
        }
        strDetails=strD ata.Split('|');
        intRowCount = strDetails.Leng th;
        Response.Write( "<table width=50% border=0 cellpadding=3 cellspacing=0 class=tbox1 id=results>");
        Response.Write( "<tr class=headbggre y color=grey>");
        Response.Write( "<td align=center valign=top class=formlefth eading>");
        Response.Write( "<span class=formlefth eading></span>");
        Response.Write( "<td valign=top class=formlefth eading>BANK NAME</td>");
        Response.Write( "</td>");
        Response.Write( "<td valign=top class=formlefth eading>ADDRESS1 </td>");
        Response.Write( "</td>");
        Response.Write( "<td valign=top class=formlefth eading>ADDRESS2 </td>");
        Response.Write( "</td>");
        Response.Write( "<td valign=top class=formlefth eading>CITY</td>");
        Response.Write( "</td>");
        Response.Write( "<td valign=top class=formlefth eading>ZIP-CODE</td>");
        Response.Write( "</td>");
        Response.Write( "<td valign=top class=formlefth eading>STATE</td>");
        Response.Write( "</td>");
        Response.Write( "<td valign=top class=formlefth eading>COUNTRY</td>");
        Response.Write( "</td>");
        Response.Write( "<td valign=top class=formlefth eading>PHONE1</td>");
        Response.Write( "</td>");
        Response.Write( "<td valign=top class=formlefth eading>PHONE2</td>");
        Response.Write( "</td>");
        Response.Write( "<td valign=top class=formlefth eading>REFERENC E</td>");
        Response.Write( "</td>");
        Response.Write( "<td valign=top class=formlefth eading>FAX1</td>");
        Response.Write( "</td>");
        Response.Write( "<td valign=top class=formlefth eading>FAX2</td>");
        Response.Write( "</td>");
        Response.Write( "<td valign=top class=formlefth eading>EMAIL</td>");
        Response.Write( "</td>");
        Response.Write( "<td valign=top class=formlefth eading>WEBSITE</td>");
        Response.Write( "</td>");
        Response.Write( "</tr>");
        string[] strArrCol;//to set Column Value

        strArrCol=strDe tails[i].Split('^');
        Response.Write( "<tr>");
        Response.Write( "<td width=25 align=left valign=top class=formlefth eading><input name=optBank id = optBank type = radio onclick=RadioCl ick('"+ strArrCol[1] +"','"+strArrCo l[0]+"','"+strArrCo l[2]+"','"+strArrCo l[3]+"','"+strArrCo l[4]+"','"+strArrCo l[5]+"','"+strArrCo l[6]+"','"+strArrCo l[7]+"','"+strArrCo l[8]+"','"+strArrCo l[9]+"','"+strArrCo l[10]+"','"+strArrCo l[11]+"','"+strArrCo l[12]+"','"+strArrCo l[13]+"','"+strArrCo l[14]+"','Modify' )></td>");
        Response.Write( "<td align=left valign=middle class=formlefth eading> " + strArrCol[1] + " </td>");

        Response.Write( "<td align=left valign=middle class=formlefth eading> " + strArrCol[2] + " </td>");
        Response.Write( "<td align=left valign=middle class=formlefth eading> " + strArrCol[3] + " </td>");
        Response.Write( "<td align=left valign=middle class=formlefth eading> " + strArrCol[4] + " </td>");
        string demo= strArrCol[4];
        Response.Write( "<td align=left valign=middle class=formlefth eading> " + strArrCol[5] + " </td>");
        Response.Write( "<td align=left valign=middle class=formlefth eading> " + strArrCol[6] + " </td>");
        Response.Write( "<td align=left valign=middle class=formlefth eading> " + strArrCol[7] + " </td>");
        Response.Write( "<td align=left valign=middle class=formlefth eading> " + strArrCol[8] + " </td>");
        Response.Write( "<td align=left valign=middle class=formlefth eading> " + strArrCol[9] + " </td>");
        Response.Write( "<td align=left valign=middle class=formlefth eading> " + strArrCol[10] + " </td>");
        Response.Write( "<td align=left valign=middle class=formlefth eading> " + strArrCol[11] + " </td>");
        Response.Write( "<td align=left valign=middle class=formlefth eading> " + strArrCol[12] + " </td>");
        Response.Write( "<td align=left valign=middle class=formlefth eading> " + strArrCol[13] + " </td>");
        Response.Write( "<td align=left valign=middle class=formlefth eading> " + strArrCol[14] + " </td>");
        Response.Write( "</tr>");

        Response.Write( "</table>");
        }

        Comment

        Working...