Posted by Jerry Stuckle on 08/23/06 10:42
Luke - eat.lemons@gmail.com wrote:
> ibreakyourlegs@googlemail.com wrote:
>
>> deko wrote:
>>
>>> Okay, I've got the combo box on the page:
>>>
>>> <select name=color>
>>> <option value=yellow>yellow</option>
>>> <option value=white>white</option>
>>> <option value=white>gray</option>
>>> </select>
>>>
>>> And I have this at the top of the page in the head section:
>>>
>>> $background = trim($_POST['color']);
>>> [and then the if-else statement with the style directives]
>>>
>>> My question is this:
>>>
>>> How do I make the page refresh after the user selects the color
>>> preference? Do
>>> I need to put the combo box inside a form? I tried this:
>>>
>>> <select name=color onChange="post">
>>>
>>> but no luck.
>>
>>
>> yes you need a form. when you have insert the form you can use this:
>> <select name=color onChange="document.NAMEOFTHEFORM.submit()"> to
>> submit the Form after selecting the value.
>>
>> greetingz
>>
> Hi,
>
> Unless you HAVE to do it with php i would do this with the following code.
>
> <input type="button" name="colr" value="BLUE"
> onclick="document.bgColor='#0000FF'">
> <input type="button" name="colr" value="RED"
> onclick="document.bgColor='#FF0000'">
> <input type="button" name="colr" value="GREEN"
> onclick="document.bgColor='#00FF00'">
> <input type="button" name="colr" value="WHITE"
> onclick="document.bgColor='#FFFFFF'">
> <input type="button" name="colr" value="BLACK"
> onclick="document.bgColor='#000000'">
>
>
> Paste that into a webdoc and test!
>
> Thanks,
>
> Luke.
Doesn't work if they have JS disabled. It also wouldn't work if he
wanted the option of an image (see the first post).
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|