Digital Point Forums
Moneygram

Go Back   Digital Point Forums > Design & Development > Programming > JavaScript
Google Analytics
Log In to view
your analytics

Reply
 
Thread Tools
  #1  
Old Apr 8th 2005, 11:02 am
strNoob strNoob is offline
Peon
 
Join Date: Apr 2005
Posts: 1
strNoob is on a distinguished road
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?
Reply With Quote
  #2  
Old Apr 9th 2005, 1:50 pm
J.D. J.D. is offline
of the Nightfall
 
Join Date: Nov 2004
Posts: 1,198
J.D. has a spectacular aura aboutJ.D. has a spectacular aura about
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()">
J.D.
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


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


All times are GMT -8. The time now is 4:17 am.