Dynamic Form Select Menus

I've noticed that when I'm inserting a dynamic drop down select menu where the options are built from a Recordset, the last record in the recordset is always selected and the menu always opens upwards. It also always ignores the fact if I throw in a static option and have that set at the default "Currently Selected" option, it will ignore that also.
In the picture below, I want the static option of "Select a Medium" to appear before a user hits the drop down select and once they hit it, I want the drop down's options to be listed in an ascending alphabetical order not to mention I'd like the menu to drop downward instead of opening upwards. (The records are currently in order in the database in an alphabetical order)
Here is the code btw
<form action="" method="get"><select name="test">
  <option value="" <cfif (isDefined("rsMediums.mediumID") AND "" EQ rsMediums.mediumID)>selected="selected"</cfif>>Select a Medium</option>
  <cfoutput query="rsMediums">
    <option value="#rsMediums.mediumID#" <cfif (isDefined("rsMediums.mediumID") AND rsMediums.mediumID EQ rsMediums.mediumID)>selected="selected"</cfif>>#rsMediums.mediumName#</option>
  </cfoutput>
</select></form>

J_Tremain requirements:
1) I want the drop down's options to be listed in an ascending alphabetical order ...(The records are currently in order in the database in an alphabetical order)...
2) I want the static option of "Select a Medium" to appear before a user hits the drop down select ...
3) I'd like the menu to drop downward instead of opening upwards.
1) Even if the records are in order in the database, the order in the result-set may be all mushed up. If you have access to the query, then add an ORDER BY clause to it, as Dave has suggested. If you don't have access to the query, then create a sorted copy of it, using query-of-a-query, and use that copy instead.
<cfquery name="rsMediums_sorted" dbtype="query">
select *
from rsMediums
order by mediumName
</cfquery>
2) By default, the first listed option appears at the top of the drop-down list. You could adapt your code as follows. This also was first suggested by from Dave. I am repeating it here to explain my suggestion about query-of-query.
<form action="" method="get">
       <select name="test">
        <option value="" selected>Select a Medium</option>
    <!--- if you applied query-of-a-query, then use rsMediums_sorted instead of rsMediums --->
        <cfoutput query="rsMediums">
            <option value="#rsMediums.mediumID#">#rsMediums.mediumName# </option>
        </cfoutput>
        </select>
</form>
3) The options in the select tag are designed to "drop down" by default. As yours is "dropping up", it can only mean that something else is affecting the page styling. Check your CSS code(if you use any), and the positioning of the other HTML elements on the page.
Having said this, I would suggest you use the following code. It gives you more possibilities:
<cfform method="get">
    <!--- if you applied query-of-a-query, then use rsMediums_sorted instead of rsMediums --->
    <cfselect name="test"  query="rsMediums" display="name" value="ID" queryPosition="below">
          <option value="" selected>Select a Medium</option>
    </cfselect>
</cfform>

Similar Messages

  • I have 3 dynamic select menus in form but when submit when error - selection is lost

    Hi does anybody know how to make these select menus stay
    other than using javascript?
    I have looked on the internet for a looooong time for this
    and have no further knowledge.
    I can however get it to stay selected in an update record but
    not in an insert record. I have tried changing the recordset but it
    doesn't work.....
    Help please it is frustrating...........especially for users
    of the form I want them to use...........

    Thanks for your reply.
    I don't use javascript and the error checking I use is php.
    The menus I use are quite large so I have placed them
    dynamically within the form:<select name="stateCode"
    class="textarea">
    <?php
    do {
    ?>
    <option value="<?php echo $row_state['code']?>"
    ><?php echo $row_state['stateCode']?></option>
    <?php
    } while ($row_state = mysql_fetch_assoc($state));
    ?>
    </select>
    There are three of these, one for location, one for category
    and one for industry.
    They aren't connected for a series of dropdowns, just in the
    form.
    Can I please ask you about the <?=$option1;?> I have
    seen this in other forms.
    I was wondering wouldn't you need to have <?php echo
    .$option1;?>.
    Still learning about this fabulous php. I have left it for a
    while do learn other things and now am trying to catch up where I
    left off.
    I don't understand the difference between having
    <?=......?> and <?php echo.....?>
    I have seen some forms use e.g. <?=$add;?> in a
    textarea or checkbox where $add is the variable for error checking.
    Thanks again for your help.

  • Create a dynamic form where selected text boxes appears, based on options chosen in a drop-down box

    HELP!!! Can anyone please provide some guidance on how to create a dynamic form where selected text boxes appears, based on options chosen in a drop-down box.
    I have a form which – based on the department that's selected from a drop-down box – will have different form fields/text boxes, etc, made available.
    Is this possible in LiveCycle, if so, can you please provide the script/info - as needed.
    Thanks,

    In the preOpen event of the second dropdown list you put something like (in formCalc):
    if (dropdown1 == 1) then
    $.clearItems()
    $.setItems("Year, 2 Year,  3 Year")
    elseif (dropdown1 == 2) then
    $.clearItems()
    $.setItems("3 Year,  4 Year")
    endif

  • Dynamic row selection based on Page member selection in Planning web-form

    Hello experts
    I have requirement where, user dont want 10 webforms to enter 2 accounts line for various sparse members. Below is the dimension detail and web-form current design
    Account - Dense
    Period - Dense
    Year - Sparse
    Scenario - Sparse
    Version - Sparse
    Entity - Sparse
    Product - Sparse (600 level 0 members)
    Product dim has family1 as parent and 40 level 0 mem like that there are 10 family level 1 members, now to enter account member (only 2 member) for 6 years projection ( it means 12 periods and 6 years in column ) , i can build 10 web-forms with one web-form has one family level-0 mem in rows,
    however my question, is how can i achieve this in one web-form, instead of 10 web-forms for 400 products ?
    your help is greatly appreciated.
    Edited by: 859874 on Jul 18, 2012 8:58 PM

    Im not sure there is any simple way to get dynamic row selection based on what is selected in the page.
    If I were designing the form based on what you have stated, I would probably stick both Account and Year in the page, and the 400 products in rows. This would require the user to select the different combinations of Year / Account, but would mean only 12 columns (instead of 72).
    Alternatively you could stick Account in rows too - meaning 800 rows, but less combinations to select in Page....all depends what is deemed acceptable to the user.
    Probably other approaches that may be better than above (put Product in the Page for fun!!)
    Thanks
    JB

  • How to create a dynamic form with bind variables :schema & :table_name

    My application has two LOV's, one to select a schema, and the next to select a table within that schema. I then have a button which passes me to a report which displays the data in that table.schema.
    I now want to create a link to a form where I can edit the record based on the rowid of that table.schema, but it doesn't appear that I can create a dynamic form where I pass the schema.table_name and rowid. Is this possible? Can anyone advise how I can do this? The form builder only wants a fixed schema/table name.
    Thanks in advance.
    Stuart.

    Hi Stuart,
    In this sort of situation, you will need to be a bit creative.
    I would suggest a pipeline function called as if it was a report.
    Then you can pipe out the required fields.
    Since you will have a variable number of fields, you could use two of the multi row field names for your field names and values.
    Then after submit, you can create your own procedure to loop through the fields (stored for you in the Apex package) and update the table as required.
    Not very specific I'm afraid, but it should work.
    Regards
    Michael

  • My dynamic form - issue with saving data (urgent-i would greatly appreciate any help)

    Hello,
    I have some problems with this dynamic form (created in livecycle)  http://www.pathology.ubc.ca/Academic_Activity_Data_Form_Jan_4_2013.pdf .  It doesn't save data unless I add a' new row' to any of these tables.   There are a few text fileds and if I type anything in there data won't be saved unless I trigger it by adding randomly a table row.  This is big problem as this form will be used for updates and if I want to change any of my entered records I will always have to remember to 'add a new row' otherwise just adding/changing text won't be saved. This might sound confusing but you will understanding what is going on if you type in your name and save the form and then type in your name, add a table row and save the form (first case won't be saved second will).
    I would greatly appreciate any help.
    Debbie

    Hi Marco Russo ,
    = CALCULATE (
        SUM ( [measure] ),
        PARALLELPERIOD (
            SAMEPERIODLASTYEAR ( DateTime[DateKey] ),
            0,
            QUARTER
    I have used the above DAX function it is working fine and i have applied same for Year , Quarter and Month 
    But when i remove month filters (Slicer) and Year filters in Power view report
     it is showing total Year values for Year and Quarter values
    for Quarter etc..
    Like below i am getting 
    Last Yr Month Amt   Current Yr Month Amt   Last Yr Qtr Amt   Current Yr Qtr  Amt    Last Yr     Current Yr
     10000                     30000                              10000                30000
                        30000       30000
    but i need Blanks in report if i am not selecting any filters
    thanks,
    Sreeni

  • With a PDF Dynamic form using show/hide actions, how to ensure that when the completed form is saved, closed and re-opened, the form still show the fields as before it was closed?

    With a PDF Dynamic form using show/hide actions, how to ensure that when the completed form is saved, closed and re-opened, the form still show the fields as before it was closed?
    I have developed a form with fields hidden by default, that become visible based on box ticked or radio button selections.
    My problem is that, when I close the form and re-open it, it comes back to it's default presentation, regardless of the information already recorded in the form (including in the now hidden fields.
    How to correct that
    Thanks in advance for any hint you can provide.

    I've had the same problem. This solved it...
    Go to the "Form properties..." in the File-menu. Select "Run-time" to the left and in the box "Scripting" Preserve scripting changes to form when saved: choose Automatically (Script-based state changes are saved locally in an insecure fashion. This option cannot be used for certified forms).
    Hope it works for you to...

  • Dynamic forms in struts

    Hi,
    I have a pretty difficult problem that I don't know how to solve using struts. I need to generate dynamic surveys from a database. The structure of the survey can be different for every different user. I really want to use the struts Form classes but I'm not sure how to do this. The only way I can think of is messy...
    For every new type of survey generated from the database...
    1. Generate a new class definition for the struts Form object and compile that.
    2. Every struts Action class that interacts with the new dynamic Form classes will need to use reflection on the dynamic Form object to be able to pull all of the data from that form.
    I'm sure there are many web sites where forms are dynamically generated and I would think this problem has already been solved. Does anyone out there have any ideas?

    Try to follow this way:
    1 provide actions chain in your configuration file like this:
             <form-bean
                  name="addFlatForm"
                  type="app.owner.forms.AddFlatForm">
                </form-bean>
            <action
                 path="/InitAddFlatForm"
                 type="app.owner.actions.InitAddFlatFormAction"
                 attribute="addFlatForm"
                 validate="false"
                 parameter="owner.extendedplace;place;/pages/AddFlat.jsp">             
            </action>
            <!-- "/pages/AddFlat.jsp" - jsp page with html:form on it-->     
            <action
                 path="/AddFlatForm"
                 type="app.owner.actions.AddFlatAction"
                 name="addFlatForm"
                 validate="true"
                 input="/pages/AddFlat.jsp">
                 <forward
                      name="success"
                      path="/shortinfo/Welcome.do"></forward>
            </action>2 first action(InitAddFlatFormAction) will be "prepare" action, where you must create new instance of the ActionForm descendant with Map, List, array etc definition. where your dynamic fields will be located , and fill the keys value from your database.
    public class InitAddFlatFormAction extends Action{
         public ActionForward execute(ActionMapping mapping, ActionForm form,
                HttpServletRequest request, HttpServletResponse response){
              //obtain parameters
              String[] params = ActionHelper.parseParameter(mapping, 3, Constants.PARAMETER_SEPARATOR);
              //get extended place from session attribute
              ExtendedPlace currPlace = (ExtendedPlace)ServletUtils.getAttribute(
                        request, params[0], ServletUtils.SESSION_SCOPE);
              //create form if form == null
             if (form == null) {
                  System.out.println("InitAddFlatFormAction::execute method: create new instance of action form.");
                  //create new form instance
                  form = new AddFlatForm(new HashMap<String, Object>());
                  //set form to selected scope attribute
                if ("request".equals(mapping.getScope()))
                     ServletUtils.setAttribute(request,
                               form, mapping.getAttribute(), ServletUtils.REQUEST_SCOPE);   //just set the value to selected scope
                else
                     ServletUtils.setAttribute(request,
                               form, mapping.getAttribute(), ServletUtils.SESSION_SCOPE);   //just set the value to selected scope
             //fill the form
             AddFlatForm flatForm = (AddFlatForm) form;
             flatForm.setValue(params[1], currPlace);
             return URIUtils.forwardAction(params[2]);
         }3 second action(AddFlatAction) will be "process" action. This action can be used when your data are successful validated.
    //any your actions4 form bean(ActionForm desctndant)
    public class AddFlatForm extends ActionForm{
         public AddFlatForm(Map<String, Object> map){
              super();
              //check input arguments
              AssertHelper.notNullIllArg(map);
              setMap(map);
         private Map<String, Object> map = null;
         public void setMap(Map<String, Object> map) {
              this.map = map;
         public Map<String, Object> getMap() {
              return this.map;
         public void setValue(String key, Object value){
              getMap().put(key,value);
         public Object getValue(String key){
              return getMap().get(key);
        public ActionErrors validate(ActionMapping mapping,
                HttpServletRequest request) {
            return (null);
    }And than in your jsp page you can use something like this:
    <%@ taglib uri="/tags/struts-html" prefix="html" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
                                            <c:set var="placeId">
                                                 <bean:write name="extPlace" property="placeInfo.id"/>
                                            </c:set>
                                            <c:set var="groupId">
                                                 <bean:write name="groups" property="filterGroupInfo.id"/>
                                            </c:set>
                                            <c:set var="filterId">
                                                 <bean:write name="filters" property="filter.id"/>
                                            </c:set>
                                            <bean:message name="filters" property="filter.filterDescription"/>
                                            <html:text property="value(${placeId};${groupId};${filterId})"/>                                                                 Something like this are displayed in struts-example.war (example application for struts1.1)
    pay attention for classes
    EditRegistrationAction.java and SaveRegistrationAction.java
    sorry for bad english... :)

  • Dynamic Date selection inactive

    Hi,
    I am not able to give dynamic date selection in a variant. (D: Dynamic date calculation).The traffic light is displayed in red and there is no options such as
    current date etc. is there any need to do some settings to get these options.

    Hi,
    have a look at the below link..  ( they have mentioned the steps of customer exit variable fassigning for reporting agent)
    https://websmp110.sap-ag.de/~form/sapnet?_FRAME=CONTAINER&_OBJECT=011000358700003598422003E
    Regards,
    Siva.

  • Dynamic forms and collection.

    Hello,
    In one of your postings you’ve explained that the collections won't work with dynamic forms.  The collection will only "see" the first instance of the subform.  You've provide link to the sample, but it does not longer work  :
    http://my.adobe.acrobat.com/p52549088/. 
    This sample shows how to manually encode data into barcode from a subform that repeats. Can you please provide a working link or sample? Is there any other suggestion on how to link barcodes on dynamic forms?
    Regards,

    Hello Dave,
    I can't say I've seen issue 1 before and would recommend contacting support.
    For item 2 I would suggest wrapping your 'line' of text in a subform then creating a script to use the setInstance method for that subform.
    Let's say you had a subform named "TextLine" (which contained a text field), a numeric field called "NumberOfLines" and a button called "SetLines". You would likely want to have javascript code on the SetLines button click event much like:
    TextLine.instanceManager.setInstances(NumberOfLines,rawValue);
    You will want to save this form as a Dynamic PDF before previewing and you will want to ensure that TextLine allows for more than one occurence (found under Object - Binding, Allow Subform to Repeat when you have that subform selected).
    You may also want to put in some validation against the NumberOfLines field to ensure it has a value.
    I hope that helps.

  • Dynamic forms and Web Services?

    So what we are trying to do is get a dynamic form's information into a database.  On the form itself we have several fields wrapped in a subform that is set to repeat.  It is bound to an element from a web service, which allows the form to grow based on the number of rows returned.  We needed to do this because depending on the selection of departments, there could be a different number of rows returned each time.  This works out fine.  The form grows to display different options, based on the selection.
    What we're having problems with is writing the changes made back to the database.  We have a web service that is bound to the subform that contains the fields, and also bound to the fields themselves, but we're only able to write the information from the last node, i.e if there were six options that were displayed, and you made changes to all six, only the changes to the last one would be written to the database.  Is there something special that needs to be done on the form side?
    Any help is much appreciated.

    Yes ...you set up the web service to recieve one parameter .....then you create a multiline field (make it invisible so the user cannot see it). Then use this command to populate the field with the form data:
    fieldname.rawValue = xfa.datasets.data.saveXML("pretty");
    Now bind this field to the web service input and call it.
    Paul

  • Dynamic Forms and PDF Preview

    I'm new to PDF forms and designer. I have encountered 2 issues that I can't get around.
    1 - PDF Preview - When I go from "body pages" to "PDF Preview" it goes into a script saying it can't download from a website and errors out. I believe it worked properly for awhile. Is this normal ? I tried to reload and repair my acrobat, but to no avail.
    2 - I'm trying to create a dynamic form and there is very little info on creating a dynamic form and what info I have found is very evasive?
    I'm trying to create a form section that has line items. I would like to have the line items expand by an input, by the user. example: the user enters # items to order "6" and then six line items appear for the user to fill out

    Hello Dave,
    I can't say I've seen issue 1 before and would recommend contacting support.
    For item 2 I would suggest wrapping your 'line' of text in a subform then creating a script to use the setInstance method for that subform.
    Let's say you had a subform named "TextLine" (which contained a text field), a numeric field called "NumberOfLines" and a button called "SetLines". You would likely want to have javascript code on the SetLines button click event much like:
    TextLine.instanceManager.setInstances(NumberOfLines,rawValue);
    You will want to save this form as a Dynamic PDF before previewing and you will want to ensure that TextLine allows for more than one occurence (found under Object - Binding, Allow Subform to Repeat when you have that subform selected).
    You may also want to put in some validation against the NumberOfLines field to ensure it has a value.
    I hope that helps.

  • Interactive, dynamic forms -- "add item line" button

    Hi there,
    I try to come up with an interactive, dynamic form. Similar to the example "purchase order" found in the example folder of Adobe Designer.
    When opening my document, there should be one item line. Then, with a click on a button "add a item-line", a second line in the same format comes up. With a Delete-button in front of each added line, the user can delete them.
    How do I do that? The book I am currently reading explains all great things (how add sound to actions etc.) but this feature I do not find.
    From the above mentioned example I understand I have to group items (header line; single item line).
    But what is the actual command to replicate that item line ? I did not find any info about that.
    I am trying for hours now,,,,,,,,
    Thanks for your hints & happy Easter :-)
    DC

    Hi,
    I am having a similar problem ... I have created a dynamic form and utilize the very same button function to create a new line from the target subform. Problem is that the button when clicked in view pdf does not create the new line as one would expect.
    I have compared my form to the sample Purchase Order sample form ... everthing maps perfectly from my form logic to the sample with one exception. In my form when you click on the subform target and you look at the object tab: subform tab you can only select 'type' and 'flow direction' --- everything else is grayed out - in the sample these are 'live' selectable fields. Also on the binding tab for the subform object the 'repeat subform for each data item' is also grayed out.
    What am I doing wrong?
    Thanks,
    Jeff Schnabel

  • Specific script not workig in dynamic forms

    Dear all,
    I have three check boxes.Third one is N/A.So when user select third one the value of first two check boxes should be null and acess should be read only.
    So i have added the following script to click and change events of the third check box.
    if(this.rawValue == 1 )
    first.rawValue = 0 ;
    second.rawValue = 0 ;
    first.access = "readOnly" ;
    second.access = "readOnly" ;
    else
    first.access = "open" ;
    second.access = "open" ;
    This is working fine if the form is save as static pdf but i need it in dynamic form.
    In dynamic form if i select first two check boxes then i select third one it's only making the first two check boxes read only.But the values are not refreshed i.e. value should be 0.it should be deselected.
    Can any one please help me to solve this problem.
    Thanks a lot in advance
    Regards
    Rakesh

    Rakesh,
    I have tested this in both Designer 7.0 and Designer 7.1, saved both times as a dynamic form and it works for me with the following javascript code on the change event in the 3rd CheckBox:
    if(CheckBox3.rawValue == 1 )
    CheckBox1.rawValue = 0 ;
    CheckBox2.rawValue = 0 ;
    CheckBox1.access = "readOnly" ;
    CheckBox2.access = "readOnly" ;
    else
    CheckBox1.access = "open" ;
    CheckBox2.access = "open" ;
    If you still don't get it to work I can send you the file that I have working.
    Catherine
    Adobe Systems

  • How I can create dynamically-formed requests or use native SQL in EJB?

    Hi all.
    I'm working around modify an example from NetWeaver Developer Studio (CarRental). I want to get ordered data from table and allow users to specify the ordering field, not in the code. EJB QL doesn't support dynamically-formed queries like "select object(b) from QuickBooking b where b.status like ?1 order by b.<b>?2</b>" so i can't passing field name as parameter into query. Creating a sorting method for every field is not good solution because I need a dynamically-formed requests.
    I think using native SQL will help but I don't know how I can use SQL in EJB.
    Thanks,
    Lev

    import javax.persistence.EntityManager;within class, place
    protected EntityManager  entityManager;of course make it public, private, whatever you need.
    Then, in your method
    entityManager.createNativeQuery(....);R. Grimes

Maybe you are looking for

  • Version Problem i got some issues...

    Dear Sir/Madam, First I'm using Tomcat 5.5 That time my process are working well done suddenly i changed Tomcat 7.0 that time i got issues.All screen are working but one screen not working. Please give some solution for me .... Below the errors are c

  • Create another form server

    Hi, I have the following requirement. We want to use the same OAS installation to test our two set of different form source code. Besides having to reinstall another new OAS environment for that purpose, i was thinking can i create another form servi

  • Error 222 no function with name "populate_list"

    Hi all, I am getting the following error when compiling a trigger: Error 222 at line 46, column 16 no function with name "POPULATE_LIST" exists in this scope. Does anyone know whats going on here. Thanks.

  • Alert by email

    Hi, Using SAP Business One 8.82 I would to setup an alert by email, and the email to be sent out daily on 11am, 7pm and 3am (Frequency of 8 hrs), the first alert to be sent out at 11am and subsequently in the interval of 8 hours.Is there anyway stand

  • Paid for OS Lion, but download was unsuccessful

    I paid for and waited patiently for 2 hours for OS Lion to download. However, I eventually got nothing more than an error message telling me that the application download was unsuccessful and needed to be repeated. For the life of me, I can't find a