You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by AKostylev <ak...@ipian.kazan.ru> on 2003/12/24 16:15:53 UTC
Select without selected value
I want to have select element without any selected values by default.
I can do this by setting selectedIndex=-1 or
value='not_existing_value' in JavaScript.
Can I do this with Struts functionality?
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re[2]: Select without selected value
Posted by AKostylev <ak...@ipian.kazan.ru>.
Wednesday, December 24, 2003, 7:02:24 PM, you wrote:
ML> Just don't set the form value.
ML> On 24 Dec 2003, at 15:15, AKostylev wrote:
>> I want to have select element without any selected values by default.
>> I can do this by setting selectedIndex=-1 or
>> value='not_existing_value' in JavaScript.
>> Can I do this with Struts functionality?
I use select with multiple=false and I don't set the parameter's
value. As result I get:
<form name="faqForm" method="post" action="/dp/showFaq.do">
<select name="id" onchange="submit()">
<option value="1">Test1</option>
<option value="2">Test2</option>
</select>
</form>
So none of options has "selected" attribute, but first option is
selected on the page.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Select without selected value
Posted by Mark Lowe <ma...@talk21.com>.
Just don't set the form value.
On 24 Dec 2003, at 15:15, AKostylev wrote:
> I want to have select element without any selected values by default.
> I can do this by setting selectedIndex=-1 or
> value='not_existing_value' in JavaScript.
> Can I do this with Struts functionality?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org