#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Australia
    Posts
    111
    Rep Power
    15

    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
    wabirdman
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2001
    Location
    jerusalem
    Posts
    0
    Rep Power
    0

    Lightbulb this should work..


    i think you want to put the <dtml-in> call outside the html tag.. like this:

    <dtml-in sql_method_name>
    <INPUT TYPE="TEXT" VALUE="<dtml-var sql_column_name>">
    </dtml-in>

    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.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Australia
    Posts
    111
    Rep Power
    15

    auto populate


    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??

    Cheers
    wabirdman
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Australia
    Posts
    111
    Rep Power
    15

    SUCCESS


    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

    <table>
    <tr>
    <td></td>
    <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>
    <TD>&nbsp;<B>3 Month:</B> <!--#var 3_MONTH_AVG --> <INPUT type="radio" name="AVG_CALL_SPEND_BASIS" value="3M" language=javascript onclick="document.thisForm.HIGH_AVG.value='<!--#var 3_MONTH_AVG -->';" checked>&nbsp;</TD>
    <TD>&nbsp;<B>6 Month:</B> <!--#var 6_MONTH_AVG --> <INPUT type="radio" name="AVG_CALL_SPEND_BASIS" value="6M" language=javascript onclick="document.thisForm.HIGH_AVG.value='<!--#var 6_MONTH_AVG -->';"></TD>
    <td></td>
    </tr>
    </table>

IMN logo majestic logo threadwatch logo seochat tools logo