473,769 Members | 4,999 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to retrieve multiple values from html:select tag.

2 New Member
In my project, there is a single select tag,

<html:select property="userN ame" size="7">
<html:options collection="Use rList" property="value " labelProperty=" label" />
</html:select>
<br><br>
<input type="button" value="Select" onClick="go()"> &nbsp;&nbsp;&nb sp;
<input type="button" value="Cancel" onClick="cancel ()">

when user choose any one and click "select" button, the value will be transfered to original window:

function go() {
var aform = document.forms[0];
var bform = window.opener.d ocument.forms[0];

bform.userName. value=aform.use rName.value

window.close();
}


Now I need to make it able to choose multiple values, so I can concatenate it and transfer to original window, how do I retrieve multiple values ? Thanks.

<html:select property="userN ame" size="7" multiple="true" >
<html:options collection="Use rList" property="value " labelProperty=" label" />
</html:select>
<br><br>
<input type="button" value="Select" onClick="go()"> &nbsp;&nbsp;&nb sp;
<input type="button" value="Cancel" onClick="cancel ()">
Sep 29 '06 #1
1 19329
ykong1214
2 New Member
Find the answer myself, use userName.option s.length and userName.option s[i].selected to do the loop and processing.
Sep 30 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
3083
by: Ramses van Pinxteren | last post by:
hello, I have a PHP/Javascript problem. If I want to make a multiple select like this one: $html .= "<td><select name='userid' onChange='changeuserinfo()' multiple size='10'>"; $html .= "<option value=''>Selecteer user</option>"; $html .= "<option value='1'>user 1</option>"; $html .= "<option value='2'>user 2</option>";
0
2261
by: Stephen Witter | last post by:
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.
2
3109
by: murraymiken | last post by:
I'm looking to have multiple multiple-select-boxes on a page. But I can only get the contents from the last selected value within a box, via PHP. I've tried numerous methods. What am I doing wrong? You can see ALL the values present in the url: http://myserver/test.php?notify_user_id%5B2%5D=1&notify_user_id%5B2%5D=2&notify_user_id%5B4%5D=2&notify_user_id%5B4%5D=3&notify_user_id%5B4%5D=4&notify_user_id%5B6%5D=4&btn_updcats=Update e.g. ...
3
4447
by: scott | last post by:
Hello all, I am ripping my hair out over this and maybe someone could help. I have a site that has groups and subgroups of those groups that all have int id's. I am trying to have a multiple select drop down (could select more than one group) like the following:
1
3453
by: intscript | last post by:
Hi everyone Is is possible to retrieve data using multiple select. Here is my SQL code: select sum(nPassengers) Planned, Actual, (sum(Planned) - Actual) Variance from ( select iDeptCode, sum(nPassengers) Planned from tbl_BusRequest where iReqTime = '1' and iDeptCode = '1' and cReqType = 'I' group by iDeptCode and
0
1403
by: sundsx | last post by:
Hi, i would sen multiple select to mysql by form, my prb is: file connect.php <?php $user="sundsx"; $pass="password"; $db="testphp"; $val_form=$_POST; $service =$_POST;
2
4473
by: Problematic coder | last post by:
I have a need in an application to have the ability to select multiple values in some kind of drop down list or maybe even a html type select box. I have found there doesn't seem to be an option to do this with a standard asp.net DDL, however it is possible using a html select box, the problem then is getting the values selected on the code behind page. I think in classic asp it would have been something like this:
0
1520
by: cmrhema | last post by:
Hi, I have two controls one html select control and one asp.net dropdownlist control. In html select control i have three maps loaded. It is loaded in the following manner. <SELECT class="TextBoxLabel" id="ddlMap" style="WIDTH: 128px;" tabIndex="1" onchange="fnChangeMap();" name="ddlMap" runat="server">
25
5403
by: bonneylake | last post by:
Hey Everyone, Well i am not sure if my question needs to be here or in coldfusion. If i have my question is in the wrong section i am sorry in advance an will move it to the correct section. Basically i have a multiple select box. An it works except for this one part i want to add to it.The first box i have is called project members which shows the users you can choose to send an email to and the other box is called assignees which is the...
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10045
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9994
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5299
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3562
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.