Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation javascript need help badly.

    Hi guys. I have a problem.
    Code:

    Code:
    <form id="studentform" name="studentform" method="post" action="studentcreation.jsp">
     
    		<td align="right">Id no</td>
    		<td>
    			<select style="width:200px" name="idno" id="idno">
          		<option></option>
        			</select>
    		</td>
    	   </tr>	
    		<tr>
    		<td align="right">Student Name</td>
    		<td><input name="studentname" type="text" id="studentname" size="29"></td>
    what i want to happen is in the dropdown, i have codes there that shows all the idno in my database. so when i click the idno, the corresponding student name will appear in the studentname textfield. can someone help me on how to do it? i think javascript onClick will be used here. any thoughts? thank you.
    Last edited by lexie; 06-03-2009 at 07:42 AM.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,037
    Thanks
    203
    Thanked 2,539 Times in 2,517 Posts
    You need to do this server-side, for example with an AJAX call.

    Are you really planning to have all the (numerous?) students' id numbers in a dropdown?


    Do please read the posting guidelines regarding silly thread titles. The thread title is supposed to help people who have a similar problem in future. Yours is useless for this purpose.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •