I have an ASP page where I have a "Repeat region" which is populated dinamycally from a Database, everything works perfectly, the thing is that I thought it would be cool to fill a row or to set its background color (for that single row) if the value of one of the fields = something in particular, and I've tried making a function that changes the style through VBscript and Java Script then trying to call the function each time or on every single line on the repeat region with no luck so far, of course I am doing something wrong so please any help is appreciated.
Here is an example of the repeat region that I have:
Note that the third and fourth recordset results have on their "class" tag an attempt to call either a JavaScript or a VBscript function, again, with no luck...
[code=asp]
<% While ((Repeat1__numR ows <> 0) AND (NOT rs_selecciona_p restamos.EOF)) %>
<tr>
<td class="style6"> <div align="center"> <a href="registro_ actividad_edita .asp?loan_id=<% =rs_selecciona_ prestamos("id_f ile")%>"><img src="images/edit_loan.gif" width="22" height="23" border="0" /></a></div></td>
<td class="style6"> <div align="center"> <a href="registro_ actividad_log.a sp?loan_id=<%=r s_selecciona_pr estamos("id_fil e")%>"><img src="images/loans_log.gif" width="20" height="24" border="0" /></a></div></td>
<td class="Call CambiaEstilos() "><div align="center"> <%=(rs_seleccio na_prestamos.Fi elds.Item("last _name").Value)% ><%=(rs_selecci ona_prestamos.F ields.Item("nam e").Value)%> </div></td>
<td class="return CambiaEstilos() "><div align="center"> <%=(rs_seleccio na_prestamos.Fi elds.Item("addr ess").Value)%> </div></td>
<td class="style6"> <div align="center"> <%=(rs_seleccio na_prestamos.Fi elds.Item("PRCO ").Value)%> </div></td>
<td class="style6"> <div align="center"> <%=(rs_seleccio na_prestamos.Fi elds.Item("PSI" ).Value)%></div></td>
<td class="style6"> <div align="center"> <%= FormatCurrency( (rs_selecciona_ prestamos.Field s.Ite m("loan_amount" ).Value), 2, -2, -2, -2) %></div></td>
<td class="style6"> <div align="center"> <%= FormatCurrency( (rs_selecciona_ prestamos.Field s.Ite m("earning").Va lue), 2, -2, -2, -2) %></div></td>
<td class="style6"> <div align="center"> <%=(rs_seleccio na_prestamos.Fi elds.Item("lend er").Value)%> </div></td>
<td class="style6"> <div align="center"> <%=(rs_seleccio na_prestamos.Fi elds.Item("clos ing_date").Valu e)%></div></td>
<td class="style6"> <div align="center"> <%=(rs_seleccio na_prestamos.Fi elds.Item("loan _status").Value )%></div></td>
</tr>
<%
Repeat1__index= Repeat1__index+ 1
Repeat1__numRow s=Repeat1__numR ows-1
rs_selecciona_p restamos.MoveNe xt()
Wend
%>
[/code]
It is not event worth it for me to post the functions Ive been using since they are really guessings on how to do it, but probably you already got the idea and if there is something missing please let me know so I can edit the this text and clarify some doubts if that helps you to give me a hand....
Thanks
Marco
Probably I am not even doing in the right way, it must be a way to do it so I hope to get any leads or tips.
Here is an example of the repeat region that I have:
Note that the third and fourth recordset results have on their "class" tag an attempt to call either a JavaScript or a VBscript function, again, with no luck...
[code=asp]
<% While ((Repeat1__numR ows <> 0) AND (NOT rs_selecciona_p restamos.EOF)) %>
<tr>
<td class="style6"> <div align="center"> <a href="registro_ actividad_edita .asp?loan_id=<% =rs_selecciona_ prestamos("id_f ile")%>"><img src="images/edit_loan.gif" width="22" height="23" border="0" /></a></div></td>
<td class="style6"> <div align="center"> <a href="registro_ actividad_log.a sp?loan_id=<%=r s_selecciona_pr estamos("id_fil e")%>"><img src="images/loans_log.gif" width="20" height="24" border="0" /></a></div></td>
<td class="Call CambiaEstilos() "><div align="center"> <%=(rs_seleccio na_prestamos.Fi elds.Item("last _name").Value)% ><%=(rs_selecci ona_prestamos.F ields.Item("nam e").Value)%> </div></td>
<td class="return CambiaEstilos() "><div align="center"> <%=(rs_seleccio na_prestamos.Fi elds.Item("addr ess").Value)%> </div></td>
<td class="style6"> <div align="center"> <%=(rs_seleccio na_prestamos.Fi elds.Item("PRCO ").Value)%> </div></td>
<td class="style6"> <div align="center"> <%=(rs_seleccio na_prestamos.Fi elds.Item("PSI" ).Value)%></div></td>
<td class="style6"> <div align="center"> <%= FormatCurrency( (rs_selecciona_ prestamos.Field s.Ite m("loan_amount" ).Value), 2, -2, -2, -2) %></div></td>
<td class="style6"> <div align="center"> <%= FormatCurrency( (rs_selecciona_ prestamos.Field s.Ite m("earning").Va lue), 2, -2, -2, -2) %></div></td>
<td class="style6"> <div align="center"> <%=(rs_seleccio na_prestamos.Fi elds.Item("lend er").Value)%> </div></td>
<td class="style6"> <div align="center"> <%=(rs_seleccio na_prestamos.Fi elds.Item("clos ing_date").Valu e)%></div></td>
<td class="style6"> <div align="center"> <%=(rs_seleccio na_prestamos.Fi elds.Item("loan _status").Value )%></div></td>
</tr>
<%
Repeat1__index= Repeat1__index+ 1
Repeat1__numRow s=Repeat1__numR ows-1
rs_selecciona_p restamos.MoveNe xt()
Wend
%>
[/code]
It is not event worth it for me to post the functions Ive been using since they are really guessings on how to do it, but probably you already got the idea and if there is something missing please let me know so I can edit the this text and clarify some doubts if that helps you to give me a hand....
Thanks
Marco
Probably I am not even doing in the right way, it must be a way to do it so I hope to get any leads or tips.
Comment