in the form file i have: <form method="post" action="actCreateUser"> <table cellspacing="2" width="100%"> <tr> <td ><em>Are you using this book to teach?</em></td> <td ><input type=radio name=teach value=y>Yes</td> <td ><input type=radio name=teach value=n>No</td> </tr> </table> </form> in file acCreateUser, I want to do that if use choos Yes radio button, i will set varible t to string Yes otehrwise set t to string No . I have: <dtml-if "teach=='y'"> <dtml-let t="Yes"></dtml-let> <dtml-else> <dtml-let t="No"></dtml-let> </dtml-if> But this does not work i get error "name 'Yes' is not defined". how can i fix this problem? Thanks
Jianping Zhu wrote:
in file acCreateUser, I want to do that if use choos Yes radio button, i will set varible t to string Yes otehrwise set t to string No . I have: <dtml-if "teach=='y'"> <dtml-let t="Yes"></dtml-let> <dtml-else> <dtml-let t="No"></dtml-let> </dtml-if> But this does not work i get error "name 'Yes' is not defined". how can i fix this problem?
You need to single quote 'Yes' and 'No' in DTML-Python-Expressions. <dtml-if "teach=='y'"> <dtml-let t="'Yes'"></dtml-let> <dtml-else> <dtml-let t="'No'"></dtml-let> </dtml-if> -mj
participants (2)
-
Jianping Zhu -
Maik Jablonski