472,119 Members | 1,450 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,119 software developers and data experts.

multiple select list - posting

I have a multiple select list and I am trying to post to a page where
I have no option to use the request.form or vbscript to iterate
through the control. The page is a sql server reporting services
report. My question is, how can I populate a hidden textbox with
multiple selected values of a select list

1) without using two forms, one posting to populate the textbox with
the list values, and

2) one to post to the report.

right now I am close using javascript:

function onClick(object) {
var allvals='';
for (var Current=0;Current <
object.MyList.options.length;Current++)
{
var text = object.MyTextBox ;
var Mysite = "<%=strWebSite%>"
if (object.MyList.options[Current].selected) {
text.value = object.MyList.options[Current].text ;
allvals=allvals + text.value + ',' ;
}
else {
text.value = '';
}
} location.href= Mysite + '&MyList=' + allvals;
}
</SCRIPT>

The only problem with this method is it returns a value like this:

value1,value2,value3,

I need:

'value1','value2','value3'
This will ultimately be used in a SQL "where in (values)" statement,
which requires strings to have ' qualifiers. I can't figure out how
too add the apostrophes and drop the last comma in javascript. I am
no javascript pro and have scoured the ng looking for examples.

any help is appreciated
Jul 19 '05 #1
0 2184

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Therese A. Sorna | last post: by
4 posts views Thread by rn5a | last post: by
7 posts views Thread by sosamv | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.