Click to See Complete Forum and Search --> : Problem accessing a java variable from .htm file


bab13
06-21-2005, 08:23 AM
Hi all,

This is the code of my .htm file and it get submitted to my servet directory and it picks up the 4 variables viz. task,name,description,date

I want to change the colour of my second column containing "description" if the content of description contains a particular value. But my problem is how do i fetch the value of the field "description".

If i try to assign a hidden variable inside the <TR> tag (i cannot assign it outside <TR> as the values is fetched only when the field 'task' equals "true") and assign it the value of the field 'description' then more than one value is fetched for the field 'description' and i can fetch its value for the first time. when it is fetched second time, there are 2 hidden variables with the same name and hence i get the value of the hidden field as undefined for the 2nd iteration. How do i fetch all the values for the variable 'description' and validate it.

I dunno if this approach is correct. Please suggest me a solution.

<FORM ACTION="/Myflow/myservlet" METHOD="POST" NAME="test">
<TABLE>
<TR task="true">
<TD width="20%" bgcolor="#CCCCCB">
<P align=left><font face="Arial" size="2">${name}</a>
</font></P>
</TD>
<TD width="60%" bgcolor="#CCCCCB">
<P align=left><font face="Arial" size="2">${description}
</font></P>
</TD>
<TD width="25%" bgcolor="#CCCCCB">
<font face="Arial" size="2">${date}</font>
</TD>
</TR>
</TABLE>

Khalid Ali
06-21-2005, 01:12 PM
2 options.

1. if the field is prepopulated from server then you can set the fields color on the server
2. if the value is being changed on the client side(that is by a user using a http browser)
then you can use JavaScript to chagne the color of the field.
For second anser post ur question in JavaScript forums