how to display values

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • curi444
    New Member
    • Jan 2010
    • 18

    #1

    how to display values

    I want to enter 2 values through textbox and when am click submit button i want to get it in another 2 textboxes.plz tell me how its code
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    I'm not sure I get what you are asking.
    Could you show us an example of what you mean? (Perhaps a short code example.)

    Comment

    • curi444
      New Member
      • Jan 2010
      • 18

      #3
      Originally posted by Atli
      I'm not sure I get what you are asking.
      Could you show us an example of what you mean? (Perhaps a short code example.)
      for example
      their is 2 textboxes and one button.am creating another 2 textboxes if am entering values in 1st 2 textboxes and enter button then the value should be display in another 2 textboxes

      Comment

      • Mayur2007
        New Member
        • Aug 2007
        • 67

        #4
        Hello,

        Look at below code hope it might be help you..

        Code:
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <title>Test page</title>
        <script type="text/javascript" language="javascript">
        function fill_value() {
        	document.getElementById("txtbox3").value = document.getElementById("txtbox1").value;
        	document.getElementById("txtbox4").value = document.getElementById("txtbox2").value;
        	return false;
        }
        </script>
        </head>
        
        <body>
        <form name="test_form" id="test_form" method="post" action="">
        <table border="0" cellspacing="0" cellpadding="5">
          <tr>
            <td>Enter Text 1<br /><input type="text" name="txtbox1" id="txtbox1" value="" /></td>
            <td>Enter Text 2<br /><input type="text" name="txtbox2" id="txtbox2" value="" /></td>
          </tr>
          <tr>
            <td><input type="text" name="txtbox3" id="txtbox3" value="" /></td>
            <td><input type="text" name="txtbox4" id="txtbox4" value="" /></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td><input type="submit" value="Submit" name="submit" onclick="return fill_value()" /></td>
          </tr>
        </table>
        </form>
        </body>
        </html>
        Thanks & Regards,
        Mayur Bhayani

        Comment

        Working...