Multiple selections in an HTML form

The option selector (<select>...</select>) in an HTML form allows the
user to make multiple selections. However, when the form parameters
are posted to an XSQL page, only the first value selected will be
assigned to the corresponding XSQL parameter.
This is very unfortunate, because I would like the selected values to
be used in a query like this:
<xsql:query>
select ...
from ...
where ...
and elem in ({@list})
and ...
</xsql:query>
where 'list' is the name of the option selector. However, since only
the first value selected is substituted, the query does not work.
The <xsql:include-request-params/> will "rowify" the values selected,
but this can only be utilized by a style sheet associated with the
XSQL page.
Does anyone know how to get access to all the selected values in the
XSQL page?
HELP!

Hi,
Here is an approach that may work for you.
In the registration process, assign each individual a userid...  e.g. bob123.
When they log into your site, create a SESSION variable, SESSION.userid = bob123.
In your db, for every player have two fields, one is the userid of the person that is attached to that player, and another field for the jersey number.  You could also have a field for assigned/unassigned.
Populate the grid with the unassigned players.  Have the empty jersey number field on the grid and make it editable.  When an individual assigns a jersey number to the person, (you can have them update after each person selected or at the end), you can let a cfc update the db and using their SESSION.userid, they become the "owner" of that player.  The update also will update the db with their jersey number.  The update can also turn them from unassigned to assigned so noone else can "claim" them.
Now anytime the user logs in, they'll have their players, easy to get to using a WHERE sql statement = WHERE SESSION.userid = bob123.
cfwild

Similar Messages

  • Multiple Select boxes in one form

    Does anyone know if it is possible to have multiple select
    boxes inside one form? I have six different select boxes that are
    generated by six separate queries. The action page for all six
    select boxes is the same so I just want one submit button so users
    don't get confuse. I don't want to cluster up the page with submit
    buttons but I may resort to that option.
    My problem is the select boxes generate a number and when
    that number is submitted I want to pass two other variables with it
    to the action page. I tried putting a "Form" tag around the 6
    select boxes. Inside each select box I tried to add an "Input
    type="hidden"" and give thte name and values that I needed. That
    worked for the first select box but when I tried the second select
    box it used the hidden values for the first select box.
    If anyone can help, I would greatly appreciate it. Or if you
    have any other suggestions I am open to any.
    Thanks

    Paross1,
    I wasn't thinking about that and you gave me a great idea.
    Here is how I changed my select boxes.
    <cfform
    action="Resolution_History.cfm?year=#year#&sessiontype=#sessiontype#&btype=res"
    name="form">
    <select name="SRINPUT">
    <option value="">SR
    <CFOUTPUT Query="findSR"><Option
    Value="#BILLNUMBER#">#BILLNUMBER#</cfoutput>
    </select>
    <select name="HRINPUT">
    <option value="">HR
    <CFOUTPUT Query="findHR"><Option
    Value="#BILLNUMBER#">#BILLNUMBER#</cfoutput>
    </select>
    <select name="SCRINPUT">
    <option value="">SCR
    <CFOUTPUT Query="findSCR"><Option
    Value="#BILLNUMBER#">#BILLNUMBER#</cfoutput>
    </select>
    <br>
    <select name="HCRINPUT">
    <option value="">HCR
    <CFOUTPUT Query="findHCR"><Option
    Value="#BILLNUMBER#">#BILLNUMBER#</cfoutput>
    </select>
    <select name="SJRINPUT">
    <option value="">SJR
    <CFOUTPUT Query="findSJR"><Option
    Value="#BILLNUMBER#">#BILLNUMBER#</cfoutput>
    </select>
    <select name="HJRINPUT">
    <option value="">HJR
    <CFOUTPUT Query="findHJR"><Option
    Value="#BILLNUMBER#">#BILLNUMBER#</cfoutput>
    </select>
    <INPUT TYPE="Submit" VALUE="Submit" alt="submit
    button">
    </cfform>
    On the action page I need the below IF statement to work so
    it will set the variables. It isn't working at this time. Its not
    bringing the values of billnumber, houseorig or the billtype.
    Do you have any thoughts? I know it is close. I need to set
    all of the inputs to input4 to generate my queries.
    <cfif form.srinput gt 0>
    <cfset houseorig eq "s">
    <cfset billtype eq "r">
    <cfset srinput eq input4>
    <cfelseif form.hrinput gt 0>
    <cfset houseorig eq "h">
    <cfset billtype eq "r">
    <cfset hrinput eq input4>
    <cfelseif form.scrinput gt 0>
    <cfset houseorig eq "sc">
    <cfset billtype eq "r">
    <cfset scrinput eq input4>
    <cfelseif form.hcrinput gt 0>
    <cfset houseorig eq "hc">
    <cfset billtype eq "r">
    <cfset hcrinput eq input4>
    <cfelseif form.sjrinput gt 0>
    <cfset houseorig eq "sj">
    <cfset billtype eq "r">
    <cfset sjrinput eq input4>
    <cfelse>
    <cfset houseorig eq "hj">
    <cfset billtype eq "r">
    <cfset hjrinput eq input4>
    </cfif>

  • Get all the values from a multiple select in a multipart form

    Hi there!
    I am using a form with enctype="multipart/form-data" in order to upload files from the form.
    I have read this page: http://commons.apache.org/fileupload/using.html and everything works well for my form.
    The only problem is that I can't get all the values from a "multiple select" html object. I get only one value.
    Using servlets I have used this method:
    public java.lang.String[] getParameterValues(java.lang.String name) But now I have enctype="multipart/form-data" in my form and I can't use this way...
    Is there a way to get all the values of a multi-valued parameter?
    Thanks a lot!
    Stefano

    Hi
    I have got solution for this problem so, I am listing here logic
    assume tag name of html
    <select name="moption" multiple="multiple">
    iterate it in as
    String moption="";
    boolean cnt=true;
    while(itr.hasNext())
    FileItem fi=(FileItem)itr.next();
    if(fi.isFormField())
    if(fi.getFieldName().equals("moption"))
    if(cnt==true)
    moption=fi.getString();
    cnt=false;
    else
    moption=moption+","+fi.getString();
    If wants more help then mail me your problem
    at [email protected]
    Thanks!
    Anand Shankar
    Edited by: AnandShankar on 6 Nov, 2009 12:54 PM

  • Multiple select lists in tabular form

    Hi,
    I created a tabular form with two select lists (Queries are same for both the select list and results around 300 records in the SQL).
    I am getting the following error:
    report error:
    ORA-20001: Error fetching column value: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    If I changed Select list to POP list, I am not getting error.
    Please suggest how to user select list in this case.
    Regards,
    Meda

    LnTInfotech wrote:
    I created a tabular form with two select lists (Queries are same for both the select list and results around 300 records in the SQL).
    I am getting the following error:
    report error:
    ORA-20001: Error fetching column value: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    If I changed Select list to POP list, I am not getting error.
    Please suggest how to user select list in this case.It is not possible. There is a 32K limit on the HTML generated for select list items. (As a type of report, tabular forms are also subject to the 32K limit on the size of a report row.)
    In terms of usability 200 options is about the maximum size I would consider sensible for a select list ( and for select lists in tabular forms, much, much fewer!)
    Use Popup Key LOVs.

  • How can i fill selection box on html form with data on the clientside?

    hi
    i want to make a html form that reads option values from the client.
    Because there are too many data, it's not reasonable for me to design a page which connects to server each time to fill the selection boxes.Instead i want to check if data resides at the clientside, if so fill selection boxes with that data, if not download it for the first time and store it on the client for later local retrieval.In addition i must be able to update that data residing on the client when i want.

    Don't see where Java comes into this. Sounds like you'd be using JavaScript on the client.
    A cookie would probably be the only way to save data on the client.

  • Checked some items of multiple-selection list box when form loaded in infopath

    Hi
    I customize sharepoint list with infopath. I have multiple-selection list box and want to checked some items of that automatically when form loaded. how can do this?
    Thanks.

    Hi,
    According to your description, my understanding is that you want to pre-select some items in the Multiple-Selection List Box.
    I recommend to follow the steps below to achieve this goal:
    Click Default Values under Data tab in InfoPath, expand the dataFields and navigate to the Multiple-Selection List Box field.
    Set the Default Value of the Multiple-Selection List Box field.
    Right click the field under the Multiple-Selection List Box group, then select Add another Value Below and set the Default Value for this field.
    Repeat step3 based on the number of the items that you want to be pre-selected.
    More information are provided in the link below:
    http://www.bizsupportonline.net/infopath2010/pre-select-items-multiple-selection-list-box-infopath-2010.htm
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Multiple Selects in a single form

    I have six select boxes and I want them in a single form.
    Below are the outputs for the select boxes.
    <cfform
    action="Resolution_History.cfm?year=#year#&sessiontype=#sessiontype#&btype=res"
    name="form">
    <select name="SRINPUT">
    <option value="">SR
    <CFOUTPUT Query="findSR"><Option
    Value="#BILLNUMBER#">#BILLNUMBER#</cfoutput>
    </select>
    <select name="HRINPUT">
    <option value="">HR
    <CFOUTPUT Query="findHR"><Option
    Value="#BILLNUMBER#">#BILLNUMBER#</cfoutput>
    </select>
    <select name="SCRINPUT">
    <option value="">SCR
    <CFOUTPUT Query="findSCR"><Option
    Value="#BILLNUMBER#">#BILLNUMBER#</cfoutput>
    </select>
    <br>
    <select name="HCRINPUT">
    <option value="">HCR
    <CFOUTPUT Query="findHCR"><Option
    Value="#BILLNUMBER#">#BILLNUMBER#</cfoutput>
    </select>
    <select name="SJRINPUT">
    <option value="">SJR
    <CFOUTPUT Query="findSJR"><Option
    Value="#BILLNUMBER#">#BILLNUMBER#</cfoutput>
    </select>
    <select name="HJRINPUT">
    <option value="">HJR
    <CFOUTPUT Query="findHJR"><Option
    Value="#BILLNUMBER#">#BILLNUMBER#</cfoutput>
    </select>
    <INPUT TYPE="Submit" VALUE="Submit" alt="submit
    button">
    </cfform>
    Once a user selects a number it will send them to an action
    page. On the action page I need the below IF statement to work so
    it will set the variables. It isn't working at this time. Its not
    bringing the values of billnumber, houseorig or the billtype.
    Does anyone have any thoughts? I know it is close to working
    and I need to set all of the inputs to input4 to generate my
    queries so I don't have to duplicate them.
    <cfif form.srinput gt "0">
    <cfset s = '#houseorig#'>
    <cfset r = '#billtype#'>
    <cfset input4 = '#srinput#'>
    <cfelseif form.hrinput gt "0">
    <cfset h = '#houseorig#'>
    <cfset r = '#billtype#'>
    <cfset input4 = '#hrinput#'>
    <cfelseif form.scrinput gt "0">
    <cfset s = '#houseorig#'>
    <cfset cr = '#billtype#'>
    <cfset input4 = '#scrinput#'>
    <cfelseif form.hcrinput gt "0">
    <cfset h = '#houseorig#'>
    <cfset cr = '#billtype#'>
    <cfset input4 = '#hcrinput#'>
    <cfelseif form.sjrinput gt "0">
    <cfset s = '#houseorig#'>
    <cfset jr = '#billtype#'>
    <cfset input4 = '#sjrinput#'>
    <cfelse>
    <cfset h = '#houseorig#'>
    <cfset jr = '#billtype#'>
    <cfset input4 = '#hjrinput#'>
    </cfif>

    give'em a break. he is probably under pressure (like we all
    have been). in response, i do not even see some of the variables
    you are checking in the second script in the first. get this one
    straight and i think it'll work.

  • Hide/Show items in Multiple selection in InfoPath 2010 Form

    I have an I an InfoPath 2010 browser enabled form with four sections. Inside each section is  a checkbox and a textbox
    What I need to do is, have a user select a desired items by checking the checkBox and the items that are not Checked are hiden. They can select (Checked) all the four CheckBoxes. I am using rules but can't seems to get this working. Any help will be appreciated.
    Ebenezer

    Ok, here is how you have to do , use expression as I mentioned in my previous post, and then use a condition like this
    (../my:group1/my:field1 = string(true()) and ../my:group2/my:field4 = string(false()) and my:field6 = string(false())) or
    (../my:group1/my:field1 = string(false()) and ../my:group2/my:field4 = string(true()) and my:field6 = string(false())) or
    (../my:group1/my:field1 = string(false()) and ../my:group2/my:field4 = string(false()) and my:field6 = string(true()))
    here I am checking for all three fields, if either of these is true then it will hide other section
    Hope this helps!
    Ram - SharePoint Architect
    Blog - SharePointDeveloper.in
    Please vote or mark your question answered, if my reply helps you

  • Creating a multiple selection image library using forms

    Hi,
    So, I have a client who I need to present with a pdf showing the images they hold currently. I have created an InDesign doc, which is 3 x 3, and has 19 pages. I have attached image for visual ref as to what each of the pages looks like.
    What I am trying to achieve, is that with each image there are three tick boxes. Yes, No and Preferred.
    When running the form through Acrobat, it picks up the fields fine, but each row is treated as one set of fields. i.e. I cannot select more than one tick box per row.
    How can I split these up so the client can freely tick any combo of the boxes (so they can check Yes and Preferred if they want) - without having to manually go in and edit the name for each field (513 times).
    Any help would be much appreciated.
    Thanks
    Miles

    The problem is you have very little control over how the Form Wizard behaves. Each group of check boxes does need to have a unique name. It's possible to automate the process of adding the check boxes by using JavaScript, but this would probably only make sense if you need to do this a lot.
    If you do, you could create something that would automaticaly populate blank image fields with a collection of images, creating as many pages as is necessary, but this would involve a bit of programming.

  • FORM MULTIPLE SELECT JAVASCRIPT

    Some folks have posted that Javascript could be used to provide a multiple-select option on a form element (users can select multiple values, which are processed into one csv string by Javascript and sent back to the appropriate column in a table)
    If you know how to do this, could you please post, step by step, how this could be accomplished. Say for a case where an employee in EMP could work in multiple departments, the DEPTNO value was a varchar and the form would enable something like 10,20,40 to be entered into the DEPTNO column via a multiple select
    I'm using 3.09

    I would also be interested in this. I've already done it the hard way...(actually it wasn't too bad after all) by writing my own function to parse the list of values and then validate them one at a time. It would be nice to be able to pick them from a list...

  • How to process Multiple Select

    In the html page, for a SELECT with MULTIPLE enabled, such as:
    <html:form action="send.do">
    <html:hidden property="idValueHidden"/>     
    <select id="test" name="search_type" size="4" multiple onChange="javascript:GetValue()
         <option value="a" selected>A</option>
         <option value="b" selected>B</option>
         <option value="c" selected>C</option>
         <option value="d" selected>D</option>
    In the GetValue()
    For a single selected, I can do:
    document.forms[0].idValueHidden.value = document.forms[0].search_type.selectedIndex;          
    But now the multiple entries are selected. I'll get multiple selectedIndex. Question now is how to get and process the selectedIndex(es) and assign to idValueHidden in the javascripts GetValue()? (I guess I need to somehow declare idValueHidden as an array then through a loop to do the get/set).
    Thanks.
    Scott

    Hi,
    Check out Steve's sample #16 "Deleting Multiple Employees Based on Selected Checkboxes" at http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html.
    Good luck,
    Hernando
    hjbconsulting at comcast dot net

  • Multiple users and multiple select options

    Hi,
    First of all, let me congratulate Oracle HTML DB team for this great product! This is extremely powerful and useful.
    I have multiple selection item on the form to generate report for the selected multiple schools. I have two critical questions.
    1) Currently I am deleting all records from database tables for multiples selects and similarly selecting all records from these tables to populate dependent LOVs and so on. This is a major issue when multiple people use this application at the same time. I looked at couple of examples to create, delete and select records based on IDs (unique) and it is not clear to me if I need to create parameter/hidden params on the reports side or on the HTML DB side or .. how do they communicate etc. Could any one clarify this process of checking for unique IDs please.
    2) Is there any way to give an option to the user to treat multiple selected item as just one single and to treat them separate? For example, if we let the user count number of students at two schools, how can we let the user count two schools separate as well as both schools together? This should also further ask for the possible options separate for both schools separate if they were to run separate.
    This is very important for me and appreciate any help from you. Thanks in advance.

    Hi,
    Could any one point me in the right direction, please!
    Thanks,

  • How will i display the multiple select ids in the dashboard ?

    I have a form where there is a multiple select. When the form is submit, the ids for the multiple select is stored in the database as concatenate. For example, multiple select : 3,9,5,1.
    The ids of the multiple select is found in a table TABLE1 and the insertion is done in another table TABLE2.
    Now I have to display them in a dashboard.
    My question is how will i display the multiple select ids in the dashboard ?
    I have to do an innerjoin with TABLE1 to retrieve the names of the multiple select ids. I don't know how to do it because the column name for multiple select in TABLE2 is of type text and the column id in TABLE1 is of type int.
    Please help me solve this problem.
    Thanks in advance

    One general advice is, never store comma-delimited lists in the database. In fact, the reason is to avoid problems like the one you now face.
    The major suggestion here is to re-design your database. Make sure each selected item (for example 3, 9, 5 or 1) is stored in its own row.
    To solve the problem as it now stands, you could do something like
    <cfquery>
    select myItems
    from table2
    where id in (select id from table 1 where ...etc.)
    </cfquery>
    Then use ColdFusion's list functions to do what your dashboard requires you to do.

  • Multiple HTML Form Selections

    Hi there:
    In my JSP page:
    <form action="MyServlet" name="myForm" method=POST>
    <select multiple name="selectMe" size=30>
    <%=aBunchOfOptions%>
    </select>
    <input type="submit">
    </form>
    This form makes a big list of parts. The user needs to be able to select more than one part at a time. How do I access the list of selected options in the servlet?
    Thanks,
    Shawn

    Use the javax.servlet.ServletRequest.getParameterValues - it'll return an array of values for the options.
    JSTL will help keep things managable in this case. Much better choice than scriptlets.

  • Jsp form - inserting multiple selection in to one column of the database

    I have this JSP/ HTML form that has fields that I can select multiple values and in the backend there is only one table. But when I select these multiple value and submit, only one value gets to the database. How do I get all the values that I selected .
    By the way I am using jdeveloper 10g and oracle 9i database
    thank you,
    san

    thanks aleena. sorry for the late reply. Because I away during the weekend. so I saw u are also into a web application project. I use jdeveloper 10g as my developing tool. its free to download for personal use. It may help you with your class project.
    also thanks to dev_AZ
    angrycat here is a similar example of my problem
    <select size="8" name="fruit" multiple>
    <option value="apple">apple</option>
    <option value="orange">orange</option>
    <option value="mango">mango</option>
    <option value="cherry">cherry</option>
    <option value="pineapple">pineapple</option>
    <option value="grapes">grapes</option>
    </select>
    if i select apple, orange,mango and cherry and submit it to the database field 'fruit', only 'apple' gets inserted. none others.
    this is the line where it is processing the value.
    String fruit=request.getParameter("fruit");
    by the way I have only one database table
    I am going to try the for loop example that aleena has posted.
    one more time thanks everyone
    santhosh

Maybe you are looking for

  • Session-timeout is happening intermittently for few users in weblogic.

    Hi, We have a war file deployed on a cluster. And from the past 3 days, few users are reporting that the session is getting timed out within 30 mins. Actually the session timeout is set for 240 mins(4 hrs), this is defined in the web.xml file. And th

  • Bank statement in reconcile window

    Hi Experts. I am entring bank statement manually. After finilize this when i open recocile window, Bank statement is not appearing in right side. Thanks & Regards Manoj S

  • Reading in integers from a text file

    Hi, I am going to go for the 'reading in from a text file' action as I haven't done this before. So I have been looking at all the examples and am trying the one out below :) My question is that though the structure seems pretty straightforward, what

  • Mail & Yahoo Mail Sending problems

    Hello all, I have finally admitted defeat. I have been using Apple Mail to pick up my Yahoo Mail for a long time without any issues. Suddenly it has decided to not send emails...and I have no idea why. I got the settings off of Yahoo's site. The pop.

  • Sales order release strategy

    hello everybody. marketing person prepares the sales order and he enters some discount in the pricing procedure. the requirement is that a higher level person will first check if the discounting and other terms & conditions have been maintained corre