Are you just trying to retain the selected option if there is an error on a
different part of the form?

I think you need to change this line:
<xsp:attribute name="value"><xsp-request:get-parameter
name="enquiry.postcode"/><esql:get-string column="id"/></xsp:attribute>

to instead be
<xsp:attribute name="value"><esql:get-string column="id"/></xsp:attribute>
<xsp:logic>
      if ((<esql:get-string
column="id"/>).equals(<xsp-request:get-parameter
name="enquiry.postcode"/>)) {
            <xsp:attribute name="selected">selected</xsp:attribute>
      }
</xsp:logic>

-Christopher




|---------+---------------------------->
|         |           Jason Lane       |
|         |           <[EMAIL PROTECTED]|
|         |           >                |
|         |                            |
|         |           04/30/2004 08:41 |
|         |           AM               |
|         |           Please respond to|
|         |           users            |
|         |                            |
|---------+---------------------------->
  
>--------------------------------------------------------------------------------------------------------------|
  |                                                                                    
                          |
  |       To:       [EMAIL PROTECTED]                                                  
                    |
  |       cc:                                                                          
                          |
  |       Subject:  xsp and selected option: HELP                                      
                          |
  
>--------------------------------------------------------------------------------------------------------------|




HI list,

I'm using XSP, ESQL/SQL and simple forms I guess, the problem is this,
I have some select lists and I want to pass the "selected" attribute to
the one the user selects:

<option value="23" >one </option>
<option value="24" selected >two </option>
<option value="25" >three </option>

In my site map I have:

<snip>

And my XSP :
<snip>
             <select name="enquiry.postcode">
                         <option disabled="true">Please
select<xsp:attribute
name="value"></xsp:attribute></option>
                                     <esql:execute-query>
                                                 <esql:query>select id,
code from pcodeareas order by
code</esql:query>
                                                             <esql:results>

<esql:row-results>

       <option>

                   <xsp:attribute name="value"><xsp-request:get-parameter
name="enquiry.postcode"/><esql:get-string column="id"/></xsp:attribute>

                   <esql:get-string column="code"/>

       </option>

</esql:row-results>

</esql:results>
                                                 </esql:execute-query>
             </select>
</xsp-formval:validate>

I'm guessing that I could do this with a logic sheet? Or should I move
this to woody / cforms?

Many thanks all.






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to