Click to See Complete Forum and Search --> : onchange in PHP


k-za
08-05-2003, 03:14 PM
I have a input SELECT in my PHP source, and the onchange event doesn't work: here is the code:

<select style='width: 200' name='client' onchange='eval(location.replace('aff_main.php?id=$aff_id&client='+this.options[this.selectedIndex].value));'>

It seems like "this.options..." is not evaluated.... Have I forgotten something????

Thanks for your help!!

Yogg
08-05-2003, 04:36 PM
What's the eval standing for ???
Maybe this would be better :

onChange="location.href='aff_main.php?id=$aff_id&client='+this.options[this.selectedIndex].value"

And don't forget to put your \ before each " in your string in your php script.

k-za
08-06-2003, 12:32 AM
No, it doesn't work... When I receive the "client" value, it's equal to "", so I suppose that "this...." is not correct...

I don't understand why