Refreshing page after select from Drop Down list

A

Anonymous

Guest
Hi, i have an employee profile page so it updates a persons details after a user fills in their details.

i want to make it so i have a drop down list (linked to DB) and when i select name = Adam Bell it will refrsh the page and pull out all details for Adam Bell from the employee database.

i have got the drop down list, how can i make it refresh and add all the details in a text area for their details.

Cheers
 
This would actually have to be done with JavaScript (which is different on each browser until all browsers adopt a standard). The two biggest ones in the windows world are MSIE and Netscape (obviously) and I think it is similar. Just have something like:

Code:
<select name="emp_drop_down" onSelect="location.href='view_details.php?id=' + document.formNameHere.emp_drop_down.selectedItem;">

  <option value="1">Whoever</option>
  <option value="2">Next name</option>
  <option value="3">And so on...</option>

</select>

Im not sure if that syntax is 100% right, but that will redirect the user when they select a name in the box to "view_details.php" with the ID in the query string. And have the view_details.php file load the information from the database. Like I said, this is JavaScript, which I dont do much with. Its either onChange or onSelect, but I cant remember which one exactly. Maybe another person here will know the exact syntax, but that is about how it goes. Best of luck!

Will
 
AaaDee said:
Hi, i have an employee profile page so it updates a persons details after a user fills in their details.

i want to make it so i have a drop down list (linked to DB) and when i select name = Adam Bell it will refrsh the page and pull out all details for Adam Bell from the employee database.

i have got the drop down list, how can i make it refresh and add all the details in a text area for their details.

Cheers

Hi Adam!

This is ansver at your question and this script working:

Code:
<FORM name=ShortcutMenu action="javascript:gotosite()" onSubmit="return chkCtry(SelectCountry);" method=post>
    
     <SELECT onchange=takeShortcut() name=SelectCountry> <OPTION value="title" 
        selected>Select a country site</OPTION> <OPTION 
              value=------------------>------------------</OPTION><OPTION 
              value="asean">ASEAN</OPTION><OPTION 
              value="anz">Australia</OPTION><OPTION
              value="india">Bangladesh</OPTION><OPTION 
              value="china">China</OPTION><OPTION 
              value="china">Hong Kong</OPTION><OPTION 
              value="india">India</OPTION><OPTION 
              value="asean">Indonesia</OPTION><OPTION 
              value="japan">Japan</OPTION><OPTION 
              value="korea">Korea</OPTION><OPTION 
              value="asean">Malaysia</OPTION><OPTION 
              value="india">Nepal</OPTION><OPTION 
              value="anz">New Zealand</OPTION><OPTION
              value="india">Pakistan</OPTION><OPTION
              value="asean">Phillipines</OPTION><OPTION 
              value="asean">Singapore</OPTION><OPTION 
              value="india">Sri Lanka</OPTION><OPTION
              value="taiwan">Taiwan</OPTION><OPTION 
              value="asean">Thailand</OPTION><OPTION 
              value="asean">Vietnam</OPTION><OPTION
      </SELECT>

This code i'm get from http://www.Seagate.COM
All copyright is ok! :D
See ya!
 
Back
Top