Jump to content


Photo

<select> onChange


  • Please log in to reply
4 replies to this topic

#1 Nothadoth

Nothadoth
  • Members
  • PipPipPip
  • Advanced Member
  • 119 posts

Posted 17 August 2006 - 10:21 PM

I am trying to use a select box (drop down) to reload the page on change to determine a variable. But i cant get it to work.

Could someone tell me how to do it? Im not sure if it's because it's in php in a print statement or whether i've just coded it wrong.

#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 17 August 2006 - 10:38 PM

Post the code!!!

#3 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 17 August 2006 - 11:27 PM

use ajax so you don't have to reloafd the entire page...
follow me on twitter @PHPsycho

#4 Nothadoth

Nothadoth
  • Members
  • PipPipPip
  • Advanced Member
  • 119 posts

Posted 17 August 2006 - 11:47 PM

select name='tariffselect' size='6' onchange='this.options[this.selectedIndex].value;
		this.selectedIndex=0;'>";

     mysql_connect('localhost','hidden','hidden'); 
mysql_select_db('noth_igbltduk'); 		  
$querysystems= mysql_query('SELECT * FROM phone_tariffs ORDER BY tariff ASC');
while($tariff = mysql_fetch_array($querysystems)) { 

print "<option name='".$tariff['tariff']."'>".$tariff['tariff']."</option>";

}
      
      print "</select>

how do i use ajax :S

#5 HeyRay2

HeyRay2
  • Members
  • PipPipPip
  • Advanced Member
  • 223 posts

Posted 18 August 2006 - 12:08 AM

http://www.ajaxfreak...m/tutorials.php




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users