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>
Similar Messages
-
is there a way to use a multiple selection box and calculate values in a text box.
I did set up a rule to set values but I won't work for my need.
so multiple selection box has pc1, pc2, pc 3. The user can select all of these or just one but no matter what selection is made the price is calculated into another box on the InfoPath form, I assume either a text box or a calculated field box?
any help or guidance would be greatly appreciated!!
RayHi Little_Ghost,
for using a form, seems quite a challenge.
when you select the selection box, or check boxes in the form, you may need to grab the all the selection, and refresh the page with the pre-selected information, so it will be loaded when the page is refreshed.
if you are using infopath template, it may be difficult, since we need 2 infopath form templates associate with list A and B individually, not sure how to interact this cross 2 infopath form template.
my infopath colleague suggest you to try to use one infopath form template with 2 data connections.
i was thinking,
if you could populate the items, for example by using getlistitem()
http://spservices.codeplex.com/wikipage?title=GetListItems
then you may put the result in an array, and ready to compare.
since you would like to use a form, then it may not updated directly, i am not quite sure for this, because as i know you may need to use a button to send out and update/refresh the fields.
http://www.quirksmode.org/js/forms.html
http://www.javaworld.com/article/2077176/scripting-jvm-languages/using-javascript-and-forms.html
or you may have to try to use the data view webpart:
http://www.dotnetcurry.com/showarticle.aspx?ID=581
Regards,
Aries
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. -
How can I see the numbers of lines selected in a Multiple Selection Box?
Hi everybody,
what I want to do is to get in an array of numbers all the lines selected.
For instance, if I select the rows 1,4 and 7 from a Multiple Selection Box
of 10 rows in total, how can I see that array when the rows 1,4 and 7 are
selected?
Because I want to connect this numbers to Case Structure and if the only
rows selected are 1,4 and 7, the Case Structure will only realize this cases,
and the rest will be ignored.
I'm sure there is some way to get what I want.
Thank you for your helpful.THANK YOU VERY MUCH. IT WORKS PERFECTLY!!!
"Dennis Knutson" wrote:
>>If you just wire the list box to an array indicator, you will see that
the>output is an array of the selected items. Auto index the array through
a>for loop that has your case statement inside.>>Dennis Knutson>>"Carlos
Jorge" wrote>>Hi everybody,>>what I want to do is to
get in an array of numbers all the>lines selected.>For instance, if I select
the rows 1,4 and 7 from a Multiple>Selection Box>of 10 rows in total, how
can I see that array when the rows>1,4 and 7 are>selected?>>Because I want
to connect this numbers to Case Structure>and if the only>rows selected are
1,4 and 7, the Case Structure will only>realize this cases,>and
the rest
will be ignored.>>I'm sure there is some>way to get what I want.>>Thank you
for your helpful.>> -
Display in multiple selection box
Hi
I have two multiple selection boxes.When i select few items in the first box and click a button it should appear on the second box.
how can it be achieved? any help would be appreciated.You could do this or using Javascript or updating the page by passing a parameter.
It depends on what u have to implement.
Ing. Steva -
Two select box in a form in JSP...Save me...Please
Hi,
My jsp page has one form with two different select/option. One select is fbox and another is tbox. tbox contains master values from db and fbox contanis some/few/no values from db.(It might be empty.) Now, I want to add a value from tbox to fbox. If that value is already in fbox then ALERT otherwise add in that value in fbox. Following is the code for that.
Would somebody help me out ? I don't know what's wrong with this code. It's not working............It's kind of serious and urgent.
function add(fbox,tbox) {
var i = 0;
if(fbox.value != "") {
var no = new Option();
for(var i=0; i < tbox.options.length; i++)
if((fbox.value == tbox.options.value) || (fbox.value == tbox.options[i].text))
alert("Value is already added. Select another item.");
break;
else
no.value = fbox.value;
no.text = fbox.value;
tbox.options[tbox.options.length] = no;
fbox.value = "";
else
alert("Please enter an item.");Hi Srinath or anybody,
Would u pl. tell me what's wrong with following code ? Javascript prompt is not invoking....U can see/find javascript function addservice(service) in my code which is called by JSP code inside in my form...
I am using Tomcat 3.3, Jdeveloper 3.2, IE 6.0 and Netscape 7.0.
I am badly working on this but Javascript prompt is not working....
Thanks for ur time and help...
Waiting for ur reply.
David
<%@ page contentType="text/html;charset=WINDOWS-1252"%>
<%@page language= "java" import= "java.sql.*,sun.jdbc.rowset.*,javax.servlet.http.*,java.lang.reflect.*,java.io.*,java.util.*,javax.servlet.*"
errorPage="error.jsp" %>
<jsp:useBean id="conn" class="package1.connectionBean" scope="session"/>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=WINDOWS-1252">
<META NAME="GENERATOR" CONTENT="Oracle JDeveloper">
</HEAD><center>
<BODY>
<script language="javascript" SRC="FormChek.js"></script>
<script language="javascript">
function CheckFstock(ftock) {
var Gooddigit = "0123456789";
if (document.formtest.ftock.value.length > 3 )
alert('Invalid Stock ! Please re-enter with less than equal to 3 digits.');
return false;
}// if ends
function CheckPostal(postal) {
var valid = 1;
var GoodChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
var Gooddigit = "0123456789";
var Goodextrs = "- ";
var i = 0;
if (document.formtest.postal.value == "")
// Return false if number is empty or length is not 7 length is not 6
alert('Invalid Postal Code ! Please re-enter now.');
valid = 0;
document.formtest.postal.focus();
return false;
}//if ends
else if(document.formtest.postal.value.length == 7)
//alert (GoodChars.indexOf(document.formtest.postal.value.charAt(0)));
for (i =0; i <= document.formtest.postal.value.length; i++)
//alert( i + "->"+ document.formtest.postal.value.charAt(0))
if ((GoodChars.indexOf(document.formtest.postal.value.charAt(0)) == -1) || (GoodChars.indexOf(document.formtest.postal.value.charAt(2)) == -1) || (GoodChars.indexOf(document.formtest.postal.value.charAt(5)) == -1))
alert("Not Valid Chacters in entered Postal Code! Please re-enter now.");
valid = 0;
document.formtest.postal.focus();
return false;
} // if ends
if ((Gooddigit.indexOf(document.formtest.postal.value.charAt(1)) == -1) || (Gooddigit.indexOf(document.formtest.postal.value.charAt(4)) == -1) || (Gooddigit.indexOf(document.formtest.postal.value.charAt(6)) == -1))
alert("Not Valid digits in entered Postal Code! Please re-enter now.");
valid = 0;
document.formtest.postal.focus();
return false;
} // if ends
if (Goodextrs.indexOf(document.formtest.postal.value.charAt(3)) == -1)
alert("Not Valid extras in entered Postal Code! Please re-enter now.");
valid = 0;
document.formtest.postal.focus();
return false;
} // if ends
} // for ends
}// else if ends
else if(document.formtest.postal.value.length == 6)
for (i =0; i <= document.formtest.postal.value.length; i++)
if ((GoodChars.indexOf(document.formtest.postal.value.charAt(0)) == -1) || (GoodChars.indexOf(document.formtest.postal.value.charAt(2)) == -1) || (GoodChars.indexOf(document.formtest.postal.value.charAt(4)) == -1))
alert("Not Valid Chacters in entered Postal Code! Please re-enter now.");
valid = 0;
document.formtest.postal.focus();
return false;
} // if ends
if ((Gooddigit.indexOf(document.formtest.postal.value.charAt(1)) == -1) && (Gooddigit.indexOf(document.formtest.postal.value.charAt(3)) == -1) && (Gooddigit.indexOf(document.formtest.postal.value.charAt(5)) == -1))
alert("Not Valid digits in entered Postal Code! Please re-enter now.");
valid = 0;
document.formtest.postal.focus();
return false;
} // if ends
} // for ends
}// else if ends
else { alert('Postalcode is not 7 or 6 charactres long ! Please re-enter now.');
document.formtest.postal.focus();
}//else ends
return valid
}//this function ends
function goback() {
history.go(-1);
function addItem(fbox,tbox)
var boxLength = tbox.length;
var selectedItem = document.formtest.list1.selectedIndex;
var selectedText = fbox.options[selectedItem].text;
var selectedValue =fbox.options[selectedItem].value;
var j;
var isNew = true;
//alert('BOx Length is : ' + boxLength);
if (boxLength != 0)
for (j = 0; j < boxLength; j++)
thisitem = tbox.options[j].text;
if (thisitem == selectedText)
isNew = false;
alert("Selected value is already available. Please select a different item");
break;
if (isNew)
newoption = new Option(selectedText, selectedValue, false, false);
tbox.options[boxLength] = newoption;
fbox.selectedIndex=-1;
function remove(box) {
if (confirm("Are you sure you want to delete. Continue?")) {
for(var i=0; i<box.options.length; i++) {
if(box.options.selected && box.options[i] != "") {
box.options[i].value = "";
box.options[i].text = "";
BumpUp(box);
function BumpUp(abox) {
for(var i = 0; i < abox.options.length; i++) {
if(abox.options[i].value == "") {
for(var j = i; j < abox.options.length - 1; j++) {
abox.options[j].value = abox.options[j + 1].value;
abox.options[j].text = abox.options[j + 1].text;
var ln = i;
break;
if(ln < abox.options.length) {
abox.options.length -= 1;
BumpUp(abox);
function Moveup(dbox) {
for(var i = 0; i < dbox.options.length; i++) {
if (dbox.options[i].selected && dbox.options[i] != "" && dbox.options[i] != dbox.options[0]) {
var tmpval = dbox.options[i].value;
var tmpval2 = dbox.options[i].text;
dbox.options[i].value = dbox.options[i - 1].value;
dbox.options[i].text = dbox.options[i - 1].text
dbox.options[i-1].value = tmpval;
dbox.options[i-1].text = tmpval2;
function Movedown(ebox) {
for(var i = 0; i < ebox.options.length; i++) {
if (ebox.options[i].selected && ebox.options[i] != "" && ebox.options[i+1] != ebox.options[ebox.options.length]) {
var tmpval = ebox.options[i].value;
var tmpval2 = ebox.options[i].text;
ebox.options[i].value = ebox.options[i+1].value;
ebox.options[i].text = ebox.options[i+1].text
ebox.options[i+1].value = tmpval;
ebox.options[i+1].text = tmpval2;
function dosubmit() {
for ( var i = 0; i < document.formtest.list2.length; i++ )
document.formtest.list2.item(i).selected = true;
for ( var i = 0; i < document.formtest.service.length; i++ )
document.formtest.service.item(i).selected = true;
function addservice(service) {
var defaultSelected = true;
var selected = true;
//alert('Here');
var input_box = prompt("Enter some text","");
//alert(input_box);
if(input_box != "")
var optionName = new Option(input_box,input_box,false,false);
var length = service.length;
service.options[length] = optionName;
else
alert("Service should not be empty ! Write Something.");
</script>
<form name="formtest" METHOD="POST" onSubmit="dosubmit()">
<% String sql;
sql = "SELECT LINEID, DESCRIP from PURCHVENDOR.AUTOLINE";
ResultSet results = conn.executeQuery(sql);
%>
<TABLE BORDER="1">
<TR>
<TD>Code/Type</TD>
<TD><INPUT TYPE="TEXT" NAME="vcode" SIZE="38">
<select name="tp">
<option value="S">Standard</option>
<option value="A">Aftermarket</option>
</select>
</TD>
</TR>
<TR>
<TD>Vendor Name</TD>
<TD><INPUT TYPE="TEXT" name="vname" SIZE="54"></TD>
</TR>
<TR>
<TD>Contact Name</TD>
<TD><INPUT TYPE="TEXT" name="cname" SIZE="54"></TD>
</TR>
<TR>
<TD>Address</TD>
<TD><INPUT TYPE="TEXT" name="address" SIZE="54"></TD>
</TR>
<TR>
<TD>P.O.Box</TD>
<TD><INPUT TYPE="TEXT" name="POBox" SIZE="54"></TD>
</TR>
<TR>
<TD>City</TD>
<TD><INPUT TYPE="TEXT" name="city" SIZE="54"></TD>
</TR>
<TR>
<TD>Province/Postal</TD>
<TD>
<INPUT TYPE="TEXT" name="province" SIZE="25" onChange="checkStateCode(this)">
<INPUT TYPE="TEXT" name="postal" SIZE="25" onChange="CheckPostal(this)"></TD>
</TR>
<TR>
<TD>Phone Number</TD>
<TD><INPUT TYPE="TEXT" NAME="pnumber" SIZE="54" onChange="checkUSPhone(this)"></TD>
</TR>
<TR>
<TD>Fax Number</TD>
<TD><INPUT TYPE="TEXT" name="fnumber" SIZE="54" onChange="checkUSPhone(this)"></TD>
</TR>
<TR>
<TD>Fee Stock/Factory</TD>
<TD><INPUT TYPE="TEXT" name="ftock" SIZE="25">
<INPUT TYPE="TEXT" name="ffactory" SIZE="25">
</TD>
</TR>
<TR>
<TD>Prefered Vendor</TD>
<TD><input type="radio" value="1" name="choice" Checked>Yes
<input type="radio" value="2" name="choice">No
</TD>
</TR>
<TR>
<TD>Line Carried</TD>
<TD><select multiple size="5" name="list1" >
<%
while(results.next())
%>
<OPTION value = "<%= results.getString("lineid")%>"><%= results.getString("lineid")%></OPTION>
<%
%>
</select>
<input type=button value="Add" onclick = "javascript:addItem(this.form.list1,this.form.list2);"</input>
<select multiple size="5" name="list2"></select>
<input type=button value="Delete" onclick = "javascript:remove(this.form.list2);"</input>
</TD>
</TR>
<TR>
<TD>Service</TD>
<TD>
<select multiple size="5" name="service"></select>
<input type=button value="Add Service" onclick = "addservice(formtest.service);"</input>
<input type=button value="Delete Service" onclick = "javascript:remove(this.form.service);"</input>
</TD>
</TR>
</TABLE>
<P><INPUT TYPE="SUBMIT" VALUE="Add" onClick="document.formtest.action='addvpdb.jsp';"</input>
<INPUT TYPE="SUBMIT" VALUE="Cancel" onClick="document.formtest.action='vendormain.jsp';"</input>
<!-- <INPUT TYPE="SUBMIT" VALUE="Cancel" onClick= "goback()"</input> -->
</P>
</center>
</form>
</BODY>
</HTML> -
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. -
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!
StefanoHi
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 -
Action multiple OM objects in one Form
Hi Experts,
The OM Processes & Forms include a number of standard forms in system such as:
- Create Position
- Change Position Attributes
- Create Org Unit
- change Org Unit
These forms work on one base object and they process the form.
We have 2 requirements:
1) Manager should be able to Process the request for multiple objects in one form. For example, if I want to delete 10 Positions though one form. The standard form selects only one position and processes the form.
I would like to know that can we develop a custom form which can select multiple objects (positions) and action them through one form only.
2) The OM Forms include the maintainence infotypes like Account Assignments IT 1008, Employee Grp/subgrp IT 1013, Work schedule IT 1011.
I would like to know if we need to add the field of new OM infotype for example Authorities and Resources IT 1010, Department and staff IT 1003, Planned Compensation 1005 in a form then
- is it possible, if yes then what is the process
- what will be the man days effort to add fields from one OM infotype.
thanks
ManuHi Heather,
in methode set_table_for_first_display you can use the parameter is_variant of type DISVARIANT. Use the field HANDLE in this structure to distinguish the two ALV Objects. Fill also field REPORT of the same structure with sy-repid.
Regards Florian -
Multiple Text Boxes into One Text Box
I need multiple text boxes to populate into one text box. I've got it to work with....
a=a + "\n " + (this.getField("Other Current Illnesses 1").value)
However, if the field is blank, it gives me a blank line. What is the code if the box is "empty" to "skip" that text box?
Here is what I tried, but it takes everything away even if there is something in the textbox:
if (this.getField("Other Current Illnesses 1").value !==null) {a=a + ""} else
a=a + "\n " + (this.getField("Other Current Illnesses 6").value)
Any help?From the sample forms supplied with the Acrobat distribution CD, you can use the "fillin" function that can process up to 3 fields at one time and automatically adjust for null value fields and add an option separator string;
The document level function:
// Concatenate 3 strings with separators where needed
function fillin(s1, s2, s3, sep) {
Purpose: concatenate up to 3 strings with an optional separator
inputs:
s1: required input string text or empty string
s2: required input string text or empty string
s3: required input string text or empty string
sep: optional separator sting
returns:
sResult concatenated string
// variable to determine how to concatenate the strings
var test = 0; // all strings null
var sResult; // re slut string to return
// force any number string to a character string for input variables
s1 = s1.toString();
s2 = s2.toString();
s3 = s3.toString();
if(sep.toString() == undefined) sep = ''; // if sep is undefined force to null
assign a binary value for each string present
so the computed value of the strings will indicate which strings are present
when converted to a binary value
if (s1 != "") test += 1; // string 1 present add binary value: 001
if (s2 != "") test += 2; // string 2 present add binary value: 010
if (s3 != "") test += 4; // string 3 present add binary value: 100
/* return appropriate string combination based on
calculated test value as a binary value
switch (test.toString(2)) {
case "0": // no non-empty strings passed - binary 0
sResult = "";
break;
case "1": // only string 1 present - binary 1
sResult = s1;
break;
case "10": // only string 2 present - binary 10
sResult = s2;
break;
case "11": // string 1 and 2 present - binary 10 + 1
sResult = s1 + sep + s2;
break;
case "100": // only string 3 present - binary 100
sResult = s3;
break;
case "101": // string 1 and 3 - binary 100 + 001
sResult = s1 + sep + s3;
break;
case "110": // string 2 and 3 - binary 100 + 010
sResult = s2 + sep + s3;
break;
case "111": // all 3 strings - binary 100 + 010 + 001
sResult = s1 + sep + s2 + sep + s3;
break;
default: // any missed combinations
sResult = "";
break;
return sResult;
Then a custom calculation field for a full business phone number consisting of 4 fields could be:
// Business telephone number w/country code and extension
function doFullBusinessTelephoneVoice() {
var cc = this.getField("business.telephone.voice.countrycode"); // country code;
var ac = this.getField("business.telephone.voice.areacode"); // area code;
var nu = this.getField("business.telephone.voice.number"); // exhchange and phone number;
var ex = this.getField("business.telephone.voice.extension"); // internal extension number;
event.value = fillin(cc.value, ac.value, nu.value, "-"); // first 3 fields;
event.value = fillin(event.value, ex.value, "", "-"); // combined 3 fields and internal extension;
doFullBusinessTelephoneVoice();
It looks like a lot of code, but it is easy to insert document level scripts into t pdf so the actual coding is not that much. And if one hase multiple fields that requrie multiple input fields, the coding task is even less compared to working out each field. -
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 -
Multiple Response Sheets for one form
Hello,
Can anyone tell me how to create multiple response sheets for the same form?
For example, my sales team needs to send the form out to different companies, but needs their responses sepearted to analyze.
Please Help!Hi,
You can only have one active Response Sheet per form, this means that while you are using the same form for different companies, the responses that everyone submits will go to this one response sheet.
However, if you just want to add other sheets in the 'View Responses' tab, for backing up data or other purposes, you can select Insert menu/Sheet in the 'View Responses' tab
In your case, it sounds like you need a form per company or you can use one form and have a field requesting the user to enter the company name (or you can have a drop down for the user to select a predefined list of companies) and then once you received all the responses, you can sort or filter the responses in the table based on the company name, for example. Or export your responses in Excel format, and do the analysis there.
thanks,
Lucia -
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
MilesThe 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. -
Multiple selection box + Substracting cascading dropdown list
I have a multi-select boxe and a drop down but instead of ADDING the choices made in the multi select box to the list of selectable items in the drop down list, I want to SUBSTRACT them.
I'll try to clearify it: if in the multi-slection box you have:
Option A and option B and
in the drop down list, you (depending on you selection) have 2 4 6 8 (options for A) or 4 8 10 12 (options for B).
When selecting BOTH A and B, the drop down liast should ONLY display the values that overlap/exist in both A and B (e.g 4 8).
This would have to work for X number of options in both the multi select box and the drop down list.
Doess anybody know how to make that work?
Thanks in advanced and kind regards!Hi Little_Ghost,
for using a form, seems quite a challenge.
when you select the selection box, or check boxes in the form, you may need to grab the all the selection, and refresh the page with the pre-selected information, so it will be loaded when the page is refreshed.
if you are using infopath template, it may be difficult, since we need 2 infopath form templates associate with list A and B individually, not sure how to interact this cross 2 infopath form template.
my infopath colleague suggest you to try to use one infopath form template with 2 data connections.
i was thinking,
if you could populate the items, for example by using getlistitem()
http://spservices.codeplex.com/wikipage?title=GetListItems
then you may put the result in an array, and ready to compare.
since you would like to use a form, then it may not updated directly, i am not quite sure for this, because as i know you may need to use a button to send out and update/refresh the fields.
http://www.quirksmode.org/js/forms.html
http://www.javaworld.com/article/2077176/scripting-jvm-languages/using-javascript-and-forms.html
or you may have to try to use the data view webpart:
http://www.dotnetcurry.com/showarticle.aspx?ID=581
Regards,
Aries
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. -
Multiple field validation under one form
I have one form and in that form i need to validate multiple inputText fields. Each inputText field has its own button for an input assistance that would later populate that particular inputText field. When i click on one of those buttons the entire page (all fields) gets validated. Does this happen because they are all under one FORM? do we have a better way of doing this and does adding inputHidden after each field fix this? im really new at this JSF. thanks.
If you don't have any required="true" fields, then let your custom validator check which button was pressed by determining the presence of the button in the RequestParameterMap. If your search button has a client ID of for example "formId:searchButtonId", then do something like in the validator:if (FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().containsKey("formId:searchButtonId")) {
// validate input for search.
}You can even pass the client ID as f:attribute along the UIInput field if you want.
The following two articles aren't strictly what you need, but it might give useful background information:
Action dependent requireness: http://balusc.blogspot.com/2007/12/action-dependent-requireness.html
f:attribute and validator: http://balusc.blogspot.com/2007/12/validator-for-multiple-fields.html -
How to return the result set of multiple select statements as one result set?
Hi All,
I have multiple select statements in my stored procedure that I want to return as one result set
for instance
select id from tableA
union
select name from table b
but union will not work because the result sets datatypes are not identical so how to go about this ?
ThanksYou have to CAST or CONVERT (or implicitly convert) the columns to the same datatype. You must find a datatype that both columns can be converted to without error. In your example I'm guessing id is an int and name is a varchar or nvarchar.
Since you didn't convert the datatypes, SQL will use its data precedence rules and attempt to convert name to an int. If any row contains a row that has a value in name that cannot be converted to an int, you will get an error. The solution is
to force SQL to convert the int to varchar. So you want something like
select cast(id as varchar(12)) from tableA
union
select name from tableb
If the datatypes are something other that int or varchar, you must find a compatable datatype and then convert one (or both) of the columns to that datatype.
Tom
Maybe you are looking for
-
Currently running XP Pro SP3
-
How to convert a jar file to a setup file
hi i have jar file and i want setup file of this so that i can install it in any system which has windows opearting system..please help me to solve this problem by mebimathew
-
Best way to copy ALL DATA from song to song?
Hello everyone, I'm in the middle of scoring a film and have ran into what seems to be a corrupted song, and want to attempt to transfer all data from this song into a new file. I'm running multiple global tracks with changes in tempos and time sigs
-
How to debug using External Breakpoint
Hello, I am using external breakpoint in system B. I am running a program in systemA which updates table in systemB through programB. I am using RFCuser to login to system B. Currently it is not going in debugging mode in program B. KIndly suggest wh
-
Question about imported wmv files
hi all, if i import a .wmv video into the library of my .fla file, does the import convert the .wmv into a flash movie? in other words, when someone views the .swf in their browser, is it played by the flash player alone, or is windows media somehow