1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Text field updation on selction of drop down list

Discussion in 'JSP' started by amar4java, Mar 10, 2009.

  1. amar4java

    amar4java New Member

    Joined:
    Mar 10, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi everyone im new to this forum and this is myfirst post so excuse me for any mistakes

    Im doing a final year project on banking i want help to move further

    basically im designed a jsp webpage in which the form has a selecttio list or drop down list which is retrieved from a database table now i want to display a value from the same table in a text field in the form when i choose an option in the drop down list ,can anyone tell me how to do this in jsp.


    thank u.
     
  2. indiansword

    indiansword Security Expert

    Joined:
    Oct 19, 2008
    Messages:
    496
    Likes Received:
    36
    Trophy Points:
    0
    Occupation:
    Operation Planner for 3 Australia
    Home Page:
    friendly welcome, and lets wait for someone to answer it :)
     
  3. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,283
    Likes Received:
    364
    Trophy Points:
    83
    Something like this

    Code:
    <script language="javascript" type="text/javascript" >
    <!--
    function my() 
    {
    	var var1;
    	var1=document.getElementsById("Text1");
    // Use Var1 to be put into something else.
    }
    -->
    </script>      
    <form id="form1" runat="server">
    	<input id="Text1" type="text" name="name_txt" value="1234567890"/>
    	<input id="Button1" type="button" value="button" onclick="my()"/>
    </form>
    
    Use Var1 to be put into something else.
     

Share This Page