12-21-04 10:55 PM
Listbox is a <SELECT>, correct?
When you submit a form with a <SELECT> element, it only passes the items
that are selected. You can either use some client-side code to mirror the
items in a hidden input, or add some javascript to select all of the items
in the <SELECT> just prior to submitting. Example:
<script type="text/javascript">
function selectAll(o) {
for(var i=0;i<o.length;i++) {
o[i].selected=true;
}
return true;
}
</script>
<form method="post" action="youraction.asp" onsubmit="return
selectAll(listbox2);">
<select name="listbox2" multiple>
''options added by your existing code
</select>
<input type="submit">
</form>
Ray at work
"f_salazar" <estel.esinf02@fac.mil.co> wrote in message
news:C04D1601-AF0E-41C2-87B7-E56D40980213@microsoft.com...
> Hi Ray !!
>
> First at all, Im not good writing english and the first message is write
in
> english and Spanish !!
>
> I have the usual page with 2 listbox to add or remove elements from one to
> another !!
>
> Im try to make a security page when you choose the users who has access to
> the Web Application, passing them from one listbox to the other !!
>
> When you are done, the you submit the page... and here is my question !!
>
> I need to be able to read the elements from the 2nd listbox (it has the
new[vbcol=seagreen]
> users) and then save that info to my database.
>
> I try using the Request.Form("listbox2") sentence and dont retreive the
> elements of the listbox !!
>
> I need to know who can I do it !!
>
> Thank you for the fast answer and for your help !!
>
> Francisco !!
>
>
> "Ray Costanzo [MVP]" wrote:
>
error?[vbcol=seagreen]
<SELECT>[vbcol=seagreen]
those[vbcol=seagreen]
> -----------------------------------------------------------------------
con X[vbcol=seagreen]
de[vbcol=seagreen]
la Base[vbcol=seagreen]
servidor.[vbcol=seagreen]
[ Post a follow-up to this message ]
|