Jan 28, 2004 #1 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...
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...
Jan 28, 2004 #2 simonchristieis Programmer Jan 10, 2002 1,144 GB do you mean like this? <input type="text" value="whatever" onChange="javascript:this.style.color='red';"> Hope this helps Simon Upvote 0 Downvote
do you mean like this? <input type="text" value="whatever" onChange="javascript:this.style.color='red';"> Hope this helps Simon
Jan 28, 2004 Thread starter #3 simonWMC Programmer Dec 2, 2002 180 GB 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 Upvote 0 Downvote
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
Jan 28, 2004 #4 simonchristieis Programmer Jan 10, 2002 1,144 GB 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. Upvote 0 Downvote
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.
Jan 28, 2004 Thread starter #5 simonWMC Programmer Dec 2, 2002 180 GB 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 Upvote 0 Downvote
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