Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: Accessing plain text in a form


Message #1 by "Damon Dak Davis" <dak_davis@h...> on Fri, 3 Aug 2001 15:06:36
I am doing something similar, but you have to put some form of a tag 
around the next.  I think I either used an <A> tag, or possibly a <DIV> 
tag.  There is probably alot of tags you could use, if it's inside a table 
you can access the <TD> tag.  Either way, you need some kind of element 
that you can give an ID to, and then access it through javascript.  There 
might actually be a <TEXT> element also that you can access via an ID?  I 
forgot if there is or not but there are many ways.  In my code the 
questions that I want to change (from black font to red font) are inside 
<TD> tags, which have a class assigned to them, such as <TD ID=tag1 
class=blacktext>, and then I change the class through javascript 
to 'redtext' when i want to change it.  Of course, with this method you 
have to setup the classes, but you could just as easily access the 
tag.styles.font properties.

> Is there any possible way to access plain text in a form since it's not 
an 'element'.
> I don't think there is but I'm giving somebody a chance to prove me 
wrong.
> 
> I have (inside a form) a table that is setup basically like a 
question/answer page.  
> FROM THE CLIENT SIDE through JavaScript, I want to change the color of a 
question to red if 
> the answer in the textbox (or dropdown box) is wrong.
> 
> Any help appreciated.
> 
> Dak Davis

  Return to Index