Select from the drop-down list point based on text box is not empty not

Hello. I have a javascript code to click a button and it will insert the date in a text box named "Controller_PDF_Creation_Doc_Control_Date" in my form. I also have a drop-down list called 'Release_Approval_Initials '. Everything I'm doing is when there is a date of entry in the text box, I want that the 'Release_Approval_Initials' of the menu drop-down default by selecting the option "TM". The drop-down list is filled dynamically too. How can I do this? Here is the code I have.

< SCRIPT LANGUAGE = "JavaScript" >

verify() {} function

var partNumber = ";

var ecoNumber = ";

var pdfDate;

var queue;

var queueValue = ";

var allArray = document.getElementById('listofids').value.split (",");

var error = false;

for (var i = 0; i < allArray.length; i ++) {}

pdfDate = document.getElementById('Controller_PDF_Creation_Doc_Control_Date'+allArray[i]).value;

<!-document.getElementById ('Controller_PDF_Creation_Doc_Control_Date1') .value =' 19 / 08/11 '; ->

queue = document.getElementById ('Release_Approval_Initials' + allArray [i]);

queueValue = tail [queue.selectedIndex] .value;

If ((pdfDate! = '' & & queueValue == '') |) (pdfDate == '' & & queueValue! = '')) {

error = true;

ecoNumber = document.getElementById('ECID'+allArray[i]).value;

partNumber = document.getElementById('Part_Number'+allArray[i]).value;

Alert ("You must enter a date of authorization to create PDF or Doc Control files and the queue to release for ECO" + ecoNumber + "part number:" + partNumber);

}

}

{if (Error)}

Returns false;

}

else {}

Returns true;

}

}

< /script >

"< cfinput type ="Text"name =" "Controller_PDF_Creation_Doc_Control_Date #ItemID #" id = "Controller_PDF_Creation_Doc_Control_Date #ItemID #" value = "#DateFormat(Controller_PDF_Creation_Doc_Control_Date,"M/D/YY")" # "size ="12"maxlength ="8"validate ="date"required ="no"message ="you must enter a valid date in the format m/d/YY in the creation of PDF files or Doc control Date">"

< cfinput type = "hidden" name = "today_date" id = "today_date" value = "#DateFormat (now ()," D/M/YY")" # "/ >"

< input type = "button" value = "today's Date" onclick = "document.getElementById('Controller_PDF_Creation_Doc_Control_Date#ItemID#').valu e = document.getElementById ('today_date') .value" >

< select name = "" Release_Approval_Initials #ItemID # "id =" Release_Approval_Initials #ItemID #">"

< option value = "" > < / option >

< cfloop query = "ShowDataEntryInitials" >

< option value = "" #Initials # ""

< cfif initial EQ ReleaseInitials > selected

< / cfif > > #Initials # < / option >

< / cfloop >

< / select >

Any help would be greatly appreciated. Thank you.

Andy

I figured out how to make it work. I just had to add parentheses in the right places to make it work. Here's what I did:

Tags: ColdFusion

Similar Questions

  • Select from the drop-down list and populate a list in another menu drop down

    I have a drop down list with 10 items in the list. If possible, would like for a selection in the drop-down list to populate a drop-down list with another list of selections. Each of the 10 points in the first list each will have a list of different options in the second drop-down list. I don't know how to build this solution.

    Thank you

    MDawn

    Hello

    It was because of the clear rawValue script that I put in the output from the drop-down list event businessFunction.

    I fixed it:

    // clear the current selection in the department dropdown
    dept0.rawValue = null;
    dept0.execEvent("exit");
    

    https://Acrobat.com/#d=MrWYQbTZIR7xJQDlm5ZSLg

    Good luck

    Niall

  • Automatically populate a drop-down list by using another selection from the drop-down list box

    New java/preparation forms so I apologize in advance.

    I currently have a menu drop-down box 1 (Occupation) with three options: "enter your own description/blank", retired housewife. When someone chooses either retirement or anyone at home, I would another drop box 2 (employer) to assign automatically "n/a. . The employer drop box has only two options: "enter your own/blank", N/A.

    Far, I could for that box to fill but only when the person clicks in the box (as if they were about to enter their own text.) Then only it will fill the drop-down list "employer." I would like it auto fill once the person has chosen retired, Virgin or stay-at-home woman without having to enter in the box (just using the arrow to the size of the drop-down list box).

    I currently have a key shot that resets the employer box when a person chooses the option vacuum/enter your own option. I then a JavaScript (only for the housewife now) that only works if you click the box of. Key combination works I want to than the other options work as well. If the client settles on white, the choice of the employer updates automatically empty without having to click in the box of. Any help (including general advice to make my code cleaner) is very appreciated!

    Current script of typing:

    If {(event.willCommit)

    If (event.value == "") this.resetForm (["use"]); of other SetFieldValues (event.value);

    }

    The current upward, mice running JavaScript :

    var v = this.getField ("Occupation") .value

    If (v is "Housewife")

    1. this.getField("Employer").value = "N/a".

    I think maybe I should use event.willCommit in my formula, but I'm not sure how to include it.

    Thank you!

    I would not use the key sequence or MouseUp actions for this, but the action post.

    Just make sure that you set the field option to validate the selected value immediately (under Properties - Options) and then use this code as the custom validation script:

    var employerField = this.getField("Employer");
    if (event.value=="Homemaker" || event.value=="Retired")
        employerField.value = "N/A";
    else employerField.value = employerField.defaultValue;
    
  • Why, when I type in the address bar and select from the drop-down list, I seem to "click on" on one of the toolbar buttons?

    I noticed recently that, sometimes, when I chose an entry in the drop-down list after I started typing in the address bar, I would get a different page than I wanted to. It turned out that I was actually clicking the bookmarks toolbar button that has been hidden under the list entry, I thought I was clicking.

    Hi, thanks, but disabling hardware acceleration does not fix it. However, I just swapped my mouse, and seems not to happen anymore!

  • Impossible to delete previously selected items from the drop-down lists at the click of the button Reset on a page of the screen.

    Hello

    I'm unable to clear previously selected items from the drop-down lists at the click of the button Reset on a page of the screen. The code I did to clear the previous value when the click on the button Reset is as below.

    {} public void onReinitialize (ActionEvent actionEvent)

    System.out.println ("onReinitialize is called ::");

    UIComponent uiComp = actionEvent.getComponent ();

    If (uiComp is nothing)

    {

    otherwise we use the button that we linked to that bean

    uiComp = getButtonResetByBean ();

    _logger.info ("reset fields: buttonID =" + uiComp.getId ());

    }

    on the other

    {

    _logger.info ("reset fields: CompID =" + uiComp.getId ());

    }

    Pass the component inside the uniforms, UIXForm, UIXSubform, UIXRegion, UIXPopup, RichCarousel

    or RichPanelCollection that contains the components to reset

    getTextIDLOV () .setValue (null);

    ResetUtils.reset (uiComp);

    }

    ---

    Using this code Iam able to clear the entrance to the text box but can not clear previously selected items from the drop-down lists when the reset button is clicked

    Can anyone please help on this issue.

    It's simple, you can set GenerateIsNullClauseForBindVars = "false" in the viewCriteria who created in EmployeeView

    After doing that it will fill the list of employees only after the Department selection

    Again check the enclosed application

    Ashish

  • Subforms making visible depending on what is selected in the drop-down list

    Good day to all;

    Looks like I'm '0' batting today. For some reason I'm not able to get a number of things working today... Maybe I should just write off that day as a loss... ; >)

    Another way; I'm trying, unsuccessfully, to get forms to become visible depending on what is selected from a drop-down list. I tried to use "switch" (see below), but I end up getting the famous error "syntax".

    I also tried an 'if' statement (see below), but that doesn't seem to work either.

    What I would like to ask you is when a user selects 1 of 2 choices 1 2 forms sub becomes visible.

    So, if the user has selected in the drop-down list of the bad and they choose now to select the right pair, I want the form incorrect sub to again become invisible.

    I'd appreciate any help

    switch (this.rawValue)

    {

    case "2" :

    staffing_inter. Presence = 'visible'

    on the other

    staffing_inter. Presence = 'hidden';

    breaking ;

    }

    IF statement

    if (this.rawValue = 2)

    {

    staffing_inter. Presence = 'visible'

    }

    else {

    staffing_inter. Presence = 'hidden';

    }

    Number of things...

    What statements do not use "else". You must specify each value. But you can nest another code in a statement that.

    Using a drop down you need to get the new value when the selection is made.

    Thus (guess what you did 'Specify the item values' liaison for the DDL tab):

    var newValue = this.boundItem(xfa.event.newText);
    switch(newValue){
         case "1":
              //code
         break;
         case "2":
              //code
         break;
         //etc.
    }
    

    Or with your statement:

    var newValue = this.boundItem(xfa.event.newText);
    
    if(newValue = 2){
        staffing_inter.presence = "visible"
    }
    else{
         staffing_inter.presence = "hidden";
    }
    
  • selections in the drop-down list in the list box

    Hello everyone, I have a ddlist which is filled from xml data. Select I would like selection appear in the list box. I am not able to understand this, can somone provide me with some guidance.

    This simliest is the script of the event: change from the drop-down list:

    ListBox1.addItem (xfa.event.newText);

  • Update from the drop-down list on the duration

    Hello, I'm fairly new to Java and Blackberry development.

    I am doing an application with a few editable text fields and drop-down lists. What I want to do is to change the options from the drop-down list (ObjectChoiceField), according to what is written on the text fields, all without pressing a button. Can someone give me a hand here? I thought to use invalidateAll to redraw the field, but I'm not sure.

    Thank you.

    OK, something else, this looks bad for me:

    your having

    unitChoiceField.setChangeListener (editListener);

    But editListener is not defined until after that, so with that statement, you're

    the listener of null changes.

    Put this line after you set your headset to changes.

    Also we say something "does not work", is not very useful.  If please do some debugging and tell us what he does not she should do this, rather than saying that it does not work.  Imagine that you took your car be fixed and told them that it did not work.  Would they be able to fix it?

  • XLATLONGNAME from the drop-down list should be a default value in the edit box

    Hello


    I have two fields in a grid, one named "TEST_Type" and one is named 'TEST_Name' edit box
    Use cases, TEST_Name by default will be TEST_Type in Drop Down.

    "TEST_Type" is the translation of edition Table and 'TEST_Name' will contain XLATLONGNAME.

    I do drag XLATLONGNAME of PSXLATITEM table in my grid and make related field and "TEST_Type" a related control field.

    Show LongName according to the value "TEST_Type.

    If the field 'TEST_Name' RowInit, I wrote

    If GetRow(). IsNew and
    No (MYRecord.TEST_NAME. Value) then
    MYRecord.TEST_NAME. Value = GetRow(). GetRecord (Record.PSXLATITEM). GetField (Field.XLATLONGNAME). Value;
    End - If;


    It gives an error

    "Class line method GetRecord account PSXLATITEM is not valid. (2 268)

    MYRecord.TEST_NAME. RowInit

    The recording has been used as a parameter of the specified method. It is not valid for the current object. »

    What is the problem?

    Is there a better solution for this use case?


    Thanks in advance

    I think you mix a few think upwards.

    The drop is on a class with the values of translate. So, when you set the property to the field from the drop-down list page to view the longxlatitem, you are finished.

    If you want to copy the xlatlongvalue for some reason any other areas, use instead the domain object properties.

    & dropdownlownlist = getrecord([YOUR_RECORD]).getfield ([YOUR_FIELD]);
    VALUE = & dropdownlownlist. LongTranslateValue;

    Kind regards

    Halin

  • Items from the drop-down list

    Is there a a way to get objects from the drop-down list to open the user clicking on the object itself (without using the button)?

    Look at this example of Niall:

    http://www.assuredynamics.com/index.php/portfolio/custom-dropdown-lists/

  • Create a list (of participants) from the drop-down list

    Hello

    I would like to create a list of participants of the selection in the drop-down list.

    After selecting one choice in the list drop-down I LCD to complete the list of people who belong to this choice and to choose those that is present at that meeting (using the check box).

    How can I do that, please?

    Thanks for all tips.

    Best,

    Marian

    Hi Marian,

    It is possible, but requires a fair bit of screenwriting. Also the page will probably need to be poured so that the table grows, objects under move down as well.

    Here is an example: https://acrobat.com/#d=X1msu65emlM10IWKxkiUyw

    Hope that helps,

    Niall

  • Select from a drop-down list and the specified element values are displayed in the textfield

    I need for one to be able to select from a list drop-down and specified the item values appear in textfield.

    For example, if I select Amy

    If I select Bob

    If I select Jane

    Amy

    Bob

    Jane (I want to appear as shown in the list)

    I associated a value to each item in the drop-down list so that the choice is easy to compare and determine what initial (default) value to the value in the text field. In my drop down list change event, I have the following:

    var sNewSel = this.boundItem (xfa.event.newText);

    Switch (sNewSel)

    {

    case '1': / / Amy

    TextField1.rawValue = "Amy \n";

    break;

    Switch (sNewSel)

    {

    case '2': / / Bob

    TextField1.rawValue = "Bob \n";

    break;

    Of course that's not work one name shows at a time. Help, please!

    Thank you

    Don't know what the code is supposed to do, but basically, you want to add the name of the drop-down list the addition on the current value of the TextField? Why not use the dropdownlist display value directly? For example on the change event:

    if ( TextField1.rawValue == null )
        TextField1.rawValue = xfa.event.newText;
    else
        TextField1.rawValue += ( "\n" + xfa.event.newText );
    
  • Command to refresh a calculated field when you select an option from the drop-down list box

    When my form user selects an option in a drop-down list box, the value in the field (in this case, Total) I would like to update, but it isn't.

    A radio button option box makes the Total-development field to automatic update when the user clicks on the radio button. But the drop-down list box is not updated Total (without clicking away from the field). I would like to add a command in the Combo Box to refresh the Total field when you selected the option to drop-down list box.

    Someone at - it a code (Javascript?) to get there.

    Thank you very much.

    You don't need a script, simply select the 'Value selected to validate immediately' checkbox on the Options tab of the dialog list box drop-down list box field properties.

  • fill a list based on a value from the drop-down list box

    Well, I know a way around it but its quite long with what I know. I worked on a better solution for a day now. So maybe (or likely) someone knows better. I'm trying to fill a drop drop down based on a user selection figure in a list of check boxes. I know I could create several drop-down lists and hide away them until the user changes the value of binding. But the dropdowns would consume a lot of space in my form design in liveCycle. So is there another way or I'm stuck he made a long journey. I also need to assign values to these elements, since they change because the values are used as item numbers later that fill a text/number field later in form as a list of materials.

    Tell me if I'm wrong, please (I'm new to all this)

    in the box in the click event

    If (this.) RawValue == 1)

    {

    dropDownList1.addItem ("item # 1", "value1111");

    dropDownList1.addItem ("item # 2", "value2222");

    }

    on the other

    {

    dropDownList1.rawValue = "null";

    }

    I'm sure that null is not good and I don't know that I have to set the drop-down menu to clear items on preOpen. Or maybe not. And there is a way to add items without the addition of a new right of the line? I'm on the right track?

    Hello

    Rather than having the script in each of the boxes, you can have the script in the event preOpen the drop-down list that leans on the boxes.

    I downloaded an example here: https://acrobat.com/#d=VwREjsMgvqXpVqPu54kSNw

    Take a look at the preOpen the dropdown event.

    // clear the dropdown displayed value and items
    this.rawValue = null;
    this.clearItems(); 
    
    // repopulate the items based on the checkboxes
    if(fruit.rawValue == 1)
    {
         this.addItem("Apples", "fruit_001");
         this.addItem("Pears", "fruit_002");
         this.addItem("Oranges", "fruit_003");
         this.addItem("Bananas", "fruit_004");
         this.addItem("Grapes", "fruit_005");
    }
    
    if(cars.rawValue == 1)
    {
         this.addItem("Volvo", "car_001");
         this.addItem("Ford", "car_002");
         this.addItem("Opel", "car_003");
         this.addItem("Toyota", "car_004");
         this.addItem("Nissan", "car_005");
    }
    
    if(counties.rawValue == 1)
    {
         this.addItem("Co. Tipperary", "county_001");
         this.addItem("Co. Cork", "county_002");
         this.addItem("Co. Dublin", "county_003");
         this.addItem("Co. Clare", "county_004");
         this.addItem("Co. Kerry", "county_005");
    }
    

    Hope that helps,

    Niall

  • How to call a taskflow based on results from the drop-down list. ?

    Hello

    I want to call a taskflow based on the results of the drop-down list, I have a drop down list with LOV, if I choose a value insofar as it must call the taskflow are entrusted to him. How to do this. ?. How to assign a taskflow for all values and how to call it. Someone please help...

    Page:

    http://Java.Sun.com/JSP/page"version ="2.1 ".

    xmlns:af ="http://xmlns.oracle.com/adf/faces/rich" >. "

    valuePassThru = 'true '.

    valueChangeListener = "#{SelectBean.onSelection}" > "

    Main.XML (TaskFlow);

    http://xmlns.Oracle.com/ADF/controller"version ="1.2">

    Choose

    Choose.JSFF

    /Web-INF/FirstTF.XML

    FirstTF

    /Web-INF/SecondTaskFlow.XML

    SecondTaskFlow

    Choose

    First

    FirstTF

    Second

    SecondTaskFlow

    Code VlaueChange Listner already told you.

    First and second pages only contain output text component in my example. I think that is not necessary

    Concerning

    Vincent

Maybe you are looking for