![]() |
|
|
#1
|
|||
|
|||
|
Change text on document onclick
I want to allow users to change the font, color, size of text etc... using a form and cookies.
That part is easy. But instead of just using a basic text form. <select> <option>red<option> <option>green</option> <option>blue</option> <option>yellow</option> etc... I wanted to use images in the form that would be clicked then submitted... I was thinking something like: <img src='red.gif' onclick='someScript(red)'> <img src='green.gif' onclick='someScript(green)'> <img src='blue.gif' onclick='someScript(blue)'> That would change the hidden form value on the fly like: <input type='hidden' name='font_color' value='+newcolor+'> I've found many examples that changed colors,font size,etc... But nothing that could change the value like what I want... is it possible? |
|
#2
|
|||
|
|||
|
You can change the value of an input element this way:
Code:
<input type="text" id="i1" value="initial value">
<some-element onclick="document.getElementById('i1').value = Math.random()">
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to optimize anchor text within my site | Laszlo | Link Development | 7 | Feb 2nd 2009 7:11 pm |
| Text Link Scams - Professionals Only | clasione | Link Development | 13 | Feb 10th 2005 4:50 pm |
| Anchor text question - use exact phrase or not? | fluke | Link Development | 13 | Jan 7th 2005 3:58 pm |
| Question about text color | ViciousSummer | HTML & Website Design | 7 | Jun 1st 2004 10:46 pm |