Populate a text area in Zope from ZSQL method
I have a field in a form which needs to be auto populated by the results of a ZSQL method. The result of the ZSQL is outputted to a column name called HIGH_AVG. I need the output of that column to auto populate a text box on the form
<input type=text value=(return of sql method)>
I have tried this
<input type=text name=HIGH_AVG value="<dtml-in sql_method_name>" </dtml-in> >
Please help with this problem
this should work..
i think you want to put the <dtml-in> call outside the html tag.. like this:
<INPUT TYPE="TEXT" VALUE="<dtml-var sql_column_name>">
be aware that if your query returns more than one record, you will end up with a number of text fields each containing the appropriate text from one of the records.
I tried doing that yitz, but it still has not worked. The only other thing I can think of is this. I only want 1 field from the ZSQL method to be returned in to the text box. I have tried cutting the ZSQL so that it only returns one field and that still does not work. I am at a complete loss as to what is happening. Is there a way in which you can call a particular field to be auto populated??
Thanks anyway, but I have worked it out. I also was able to have radio buttons that changed the value in the text box.
code for anyone who cares
<TD valign="top" NOWRAP><B>Average Spend:</B></TD>
<td><!--#in sql_handset_details_for_handset_code --><input type=text name=HIGH_AVG value="<!--#var HIGH_AVG -->"><!--#/in--></td>