Passing value to JSP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bytesbytes
    New Member
    • Apr 2008
    • 16

    Passing value to JSP

    JSP
    Scenario:
    Login page containing user id and pwd text boxes, each having a key boad button (onclicking the key board button will take to key.jsp where the user can input values in text box)
    The keyed value in key.jsp text box should be returened to login.jsp in corresponding to the button clicked.(ie if user clicked useridtext box key board button then the value in key.jsp should be placed or if user clicked the pwd text keyboard button then the key.jsp text box should return the value to login.jsp of pwd field)

    For further more understandings provided sample codings.
    please help me.
    THANKS in advance

    Login.jsp
    <input type="text" name="name" /> [user id text]
    <img src="login.jpg" name="login" id="login" onclick="clicke d('1')"/> [Keyboard 1 for user id]

    <input type="password" name="name" class="btn" /> [Password text]
    <img src="pwd.jpg" name="login" id="login" onclick="clicke d('2')"/> [Keyboard 2 for pwd id]

    <script>
    function clicked(x)
    {
    //..?
    document.login. action="key.jsp "
    }
    </script>

    *************** *****
    Key.jsp
    <input name="textfield " type="text" /> [text box]

    <img src="a.gif" onclick="type(' a')"/> [letter a]
    <img src="b.gif" onclick="type(' b')"/> [letter b]
    <img src="okbutton.g if" onclick="okay() "/> [OK button]

    <script>
    function type(x){
    var object =document.getEl ementById("text field");
    var append = object.value;
    object.value=ap pend+x;
    }

    function okay()
    {
    // should return the value of text box to the coresponding text box of login.jsp
    }
    </script>
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Read about the request.getPara meter() method.

    Comment

    • bytesbytes
      New Member
      • Apr 2008
      • 16

      #3
      Thanks .

      Comment

      Working...