469,645 Members | 1,127 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

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 2096

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
By using this site, you agree to our Privacy Policy and Terms of Use.