Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

changing text properties in text form field

Status
Not open for further replies.

simonWMC

Programmer
Dec 2, 2002
180
GB
Hi

Does anybody know the javascript code that would allow me to set the properties of text in a text form field inside a form.

I want to set font, color, ect - but change it to red if it doesn't match what i want the user to type.

hope this makes sense...
 
do you mean like this?

<input type=&quot;text&quot; value=&quot;whatever&quot; onChange=&quot;javascript:this.style.color='red';&quot;>

Hope this helps

Simon
 
Cheers Simon

Not quite,

say i am asking the question : 'what does a chicken lay ?'

if the user types 'eggs'

then it just appears as normal in the text box

however - if the user types 'eggrrr'

the 'rrr' as the unexpected text wouild be typed in red

thanks again
 
This is not possible in a input field - all you can do is change all of the text in the field not parts of it.

 
i am using coursebuilder, and was under the impression that i could use the action manager to call javascript for this

thanks for your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top