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:

<map:match pattern="body-*.xml">
                                <!-- conditional select, select xsp for form -->
                                <map:select type="parameter">
                                        <map:parameter name="parameter-selector-test" 
value="{1}"/>
                                                <map:when test="quote">
                                                        <!-- start validation action 
-->
                                                        <map:act type="formval">
                                                                <map:parameter name="descriptor" 
value="descriptor.xml"/>
                                                                <map:parameter name="validate-set" 
value="quote-eval"/>
                                                                <!--+
                                                                        | this is the 
success case
                                                                        +-->
                                                                <map:generate type="serverpages" 
src="body/thankyou.xsp"/>
                                                                <map:transform 
src="../xsl/body2html.xsl"/>
                                                                <map:serialize/>
                                                        </map:act>
                                                        <!--+
                                                                | this branch contains 
the failed validation.
                                                                |If failed throw back 
to the original form
                                                                +-->
                                                        <map:call 
resource="dynamic-page">
                                                                <map:parameter name="target" 
value="quote"/>
                                                                <map:parameter name="remove" 
value="{0}"/>
                                                        </map:call>
                                                        <!--<map:generate type="serverpages" 
src="body/{1}.xsp"/>
                                                        <map:transform 
src="../xsl/sql2xmlform.xsl"/>-->
                                                </map:when>
                                                <map:otherwise>
                                                        <map:generate 
src="body/{1}.xml"/>
                                                </map:otherwise>
                                </map:select>
                                <map:serialize type="xml"/>
                        </map:match>

And my XSP :

<xsp-formval:validate name="enquiry.postcode">
<xsp:logic>
if (userHasSeenForm) {
if (<xsp-formval:is-null name="enquiry.postcode"/> ) {
<error class="error">* required.</error>
}
}
</xsp:logic>
<label>Postcode:</label>
<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