Victor escribió:
> 
> Hello,
> 
>  Is there any (easy) way to let a user to set the value of a
>  variable by simply clicking on a hyperlink on a web page?
>  I mean if I have a 3 links on a page if the user clicks on image1 to
>  set a variable $var=1,if clicks on image2 to set it as
>  $var=2,etc.
> 
>  Any suggestions (including RTFMs ;-)) are wellcome.
> 
> Best regards,
>   Victor
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

Put this.

<img src="xxx" onclick="document.form_name.foo.value=1;">
<img src="xxx" onclick="document.form_name.foo.value=2;">
<img src="xxx" onclick="document.form_name.foo.value=3;">

<form name="form_name">
<input type="hidden" name="foo">
</form>


When the user clicks the img item, JavaScript will put the foo hidden
input to the value selected.


Bye.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to