How Pre-select value in list drop-down auto

Hello

I have an automatically populated drop-down list, and I'm trying to show with a value selected (in example 5). I didn't know where to start, so I changed the code in Dreamweaver for "set value equal to" leave the function of dynamic list. List views, but the default value 0. What Miss me?

<? PHP
echo "< select name ="firstnumber"id = ' number' > ';"
for ($j = 0; $j < 11; $j += 1)
{
echo "< option value =------' $j\ ' <? PHP if (!) ((strcmp (\"$j\",5)))) {echo \"selected=\"selected\"\ ';}? "> $j < / option > \n";
}
echo "< / select >.
? >

Thank you

Tim

The problem is that you have nested PHP tags inside a PHP block. You can't do that. In fact, it is surprising that the code works at all. Normally, nesting tags PHP inside a block of PHP code will cause a syntax error.

In addition, your code is very hard to read because of the way you use double quotes all the time. It is best to use single quotes for strings, except when you need display the value of a variable inside a string. You can also nest the double quotes inside a string in single quotes and vice versa, for code that is easier to read without the backslashes.

That's how I rewrote your code:


Tags: Dreamweaver

Similar Questions

  • move selected value in one drop-down list to another

    Hello

    I have two lists, and I wanted to make sure that people choose in the first drop-down list before selecting from the second drop-down list. What I tried to do was so, if the user tries to choose something in the second and the first list was unsuccessful, an error message appears asking the user to select from the list.

    The problem I encountered: I can't change the value in the first list to the second list to check and see if the first list got whatever it is selected. Any idea?

    First list: Department

    second list: jobs

    in the first drop-down list

    var selected = xfa.event.newText;

    second drop-down list

    If (selected == "" |) some == "null") {}

    xfa.host.messageBox ("Please select from the first menu drop-down before choosing from this list.");

    }

    Thank you

    F.

    Hello

    In the first drop-down menu script, you declare a variable "selected". This form variable lives only in this event. You can not variable accessthat other events or other objects.

    You are on the right track, but rather to test the variable in the stated case, test the rawValue of the first dropdown.

    if (dropdown1.rawValue == null || dropdown1.rawValue == "")
    {
         xfa.host.messageBox(...);
         xfa.host.setFocus("xfa.form.form1.page2.dropdown1");
    }
    

    Hope that helps,

    Niall

  • Capture the value in list drop-down dashboard

    Hey,.
    Is it possible to capture the value we select from the drop-down list.

    -Amit

    Hi Amit,

    Can you close (set as reply) this thread as he approached the reading drop-down data

    Thank you!

    -Joe

  • List drop-down auto

    Seasons greetings,

    I was wondering if it is possible to have a drop-point list 'automatically' drop-down list when the element has focus?

    Pretty sure this isn't a parameter of APEX, but ensure that JavaScript could do.

    Didn't need to select a default entry.  Just need to expand to highlight the fact that the user must choose a.

    11g - WIN - APEX 4.2

    Thank you

    Hi Samuistu,

    Samuistu wrote:

    Seasons greetings,

    I was wondering if it is possible to have a drop-point list 'automatically' drop-down list when the element has focus?

    Pretty sure this isn't a parameter of APEX, but ensure that JavaScript could do.

    Didn't need to select a default entry.  Just need to expand to highlight the fact that the user must choose a.

    11g - WIN - APEX 4.2

    Seasons greetings to you as well.

    By this do you mean that this selection list should show the options when the mouse is hovered over the selection list?

    If so, here is a small demo made some time ago:

    https://Apex.Oracle.com/pls/Apex/f?p=25147:1

    Here is the related thread where the explanation on how to do this is given.

    Reference: Re: hide/show features in Oracle Apex

    Kind regards

    Kiran

  • Fill list drop-down auto

    I'm designing

    a form with a drop-down combo of a box

    He's 51 States and I want the car if I get

    You can select a state (he) it displays I say tax rate of

    it in a textbox control. But I want to do this for all States

    It seems an if statement or xml will be my best bet

    and sample or tutorial somewhere

    It is a two part problem, linking data and access to data sources. The following addresses a problem, data binding. Build an XML instance to express the rate of sales tax in the State. I made a partial list of the States and added "TaxRates.xml" as the source of the preview data.

    Built a XML schema to describe the XML instance and add them as a data connection. My schema is embedded in the attached form. The "TaxRates.xsd" scheme is also attached.

    http://www.w3.org/2001/XMLSchema"xmlns:xfadata ="http://www.xfa.org/schema/xfa-data/1.0/">."

    Use dynamic binding to bind the drop-down list the data connection state. In 'State' data binding to specify the text of the element as the 'id' attribute and the value of the element that the attribute "Salestax".

    In the case of the release of 'the State' add JavaScript to assign the gross value of the 'State' to the gross value of the "taxRate".

    Form1.Page1.Subform1.State::exit - (JavaScript, client)

    This.rawValue = Form1.Page1.Subform1.taxRate.RawValue;

    Steve

  • Is there a way to child entities of control based on the values of list drop down Parent entity on the screen of the user interface

    Hi team,

    Need your inputs / help on the scenario below.

    I created the interested part called parent entity (created attributes stakeholder list dropdown attribute with values 'Individual' and 'Organization' and a few other attributes on this entity).

    Child entities created called 'the individual' and 'organization' and created interview screens as below.

    1 entity parent on a single screen (interested party)

    2. child entity on a single screen (the individual)

    3. the entity child another (the Organization) on another screen and created vibility rules like this and applied at the level of the screen.

    Individual information should be displayed, if

    for each all instances of the interested party , the interested party is individual

    Organization identity information should be displayed if

    for each all instances of the interested party , the Type of party's organization

    I created 2 instances. We're interested type as an "individual" and other is by "organization". But as soon as I click on the next button, it doesn't show any entity child screen because it is directly go to another screen.

    If I create instances with the same type, he has been creating the filter based on the type. Please let me know if there is any change to the rules of visibility.

    Thank you

    Viv

    I created as below and the problem is solved without the help of the functions of the entity.

    Individual information should be displayed, if

    the interested party Type = 'individual '.

    Organization identity information should be displayed if

    the party interested in Type = "organization".

    Thank you

    Vivek

  • How to choose a specific value in a drop-down list using javascript

    Hello

    I'm looking for a way to select a specific value in a drop-down list (the first value) using javascript? How would I do that? Thank you in advance.

    Here's how you can select the first item without having to know what it is:

    Set the value of the drop-down list to the first element cb1

    var f = getField ("cb1");

    var val = f.getItemAt (0, true);

    If (val) f.value = val;

    Change 0 to a different index if desired, or use-1 for the last item in the list. More information for the field getItemAt method is in the Acrobat JavaScript documentation.

  • Select the value in the drop-down list ADF/JSF without command button

    Hello

    My request is constructed using ADF and JSF (and JDev 10.1.3) and the form of a table with 2 drop downs. When the user selects a value in the first descent down, the program should go to the database and extraction of valid values for the second drop-down list. This is the case on the selection of the value in the drop-down and the user should not be required to click on any button command like 'Go' or ' Submit'

    I'm new to JSF/ADF. How to get there? Any body there the code examples for this?

    Thank you

    http://tinyurl.com/ygnvl87 :D

    John

  • selecting a value in the drop-down list but page must not get recharged again.

    Hello
    I created a drop-down list. After you have selected a value from him, I can get a value in the box of text below according to updon one sql query. but the problem is that I HAV to select Page Action when the changed value parameter to the set value and redirect. Thanks to her whenever I have to select a value from the drop-down list, page get updated. Is there a way that will satisfy the requirement but page does not get new dependants.
    I use apex 4.2.
    Thank you

    You can create A dynamic Action to set the value while changing the value in the Select list (drop-down list).

    Event: change
    Selection type: item (s)
    Article (s): choose your selection list item
    Action: Execute the PL/SQL Code
    PL/SQL code:

    begin
    select colum_name into :Px_text_item_name from table where column_name=:px_select_list_name;
    end;
    

    Page elements to send: px_select_list_name
    Page referred to return: Px_text_item_name

    Its work for me without refreshing the page. Assume that, if you want to pass this value to the element in another page, then use the branch for redirection and assign the value to the element on the page of another.

    Thank you
    Lacombe

  • get the index of a selected item in a drop-down list box

    Hello

    If I have a list of strings in a drop-down list box and the user selects one in the drop-down menu, how can I get the index?  I was able to explore the table for the selected channel, but it seems like duplication of effort to create a list and then go back and research it.

    Thank you

    Brendon

    It's easier to change control of the ring or Enum which gives the index as a default value, a drop-down list box gives a string that must be converted. But if you like really graphic and you want to use the drop-down list you can uncheck the "use strings as values" option and enter the index as numbers and then make a string to Decimal conversion.

    /Y

  • How can I create a menu drop-down list dynamics that controls two separate drop-down lists?

    Hello

    I could use help decipher how to control 2 separate drop-down lists ('b' and 'c') through the value selected in the main drop-down menu (that is, 'a').

    My script worked perfectly to control another menu drop down, however I can't seem to properly control the third zone.

    In my example below, what I'm trying to do is control 'Method - external' and 'Department - external', through my gout primary to the bottom of the list. The external 'method -' drop-down list works fine, it is the third 'Department - external' that I fight with.

    For example, if 'Theft' is chosen in the first drop-down menu, I want 'Method - external' to display the series points and "Department - external" to display a different set of items. If 'Cyber Crime' is selected in the main menu down, then the external 'method' - set items will change and the external "Department -" will indicate N/A.

    With the following script - no matter what happens if I choose 'Flight' or 'Cyber Crime' in the first menu drop down, 'Cyber Crime' n/d game elements are displayed in the external "Department -" drop-down.

    I apologize if this is hard to follow - it is certainly difficult to explain. I hope that my question came through.

    Here's my current script

    Switch (event.value) {}

    case 'flight ':

    this.getField("Method-External").setItems (["","grab and run", "shopping cart/basket Walk Out", "Possession", "Consumption", "Other"]);

    break;

    this.getField("Department-External").setItems (["","Agro", "Automobile", "Bakery", "Building materials", "Chemical", "Cleaning supplies", "Candy", "Dairy products", "Deli/Bistro", "ELECTRIC", "Electronics", "Farm equipment", "Fashion", "Feed", "Fertilizer"]);

    break;

    cases of "fraud":

    this.getField("Method-External").setItems (["", "credit card", "debit card", "Check", "Coupon", "Counterfeit", "Merchandise Return", "Price Switching", "Self Check-out", "Provider", "Other"]);

    this.getField("Department-External").setItems (["", "s/o"]);

    break;

    case 'flight ':

    this.getField("Method-External").setItems (["", 'threat of concealed weapon', 'Threat from weapon', "Verbal threats", "Acts of aggression", "Other"]);

    break;

    case 'exit and enter:

    this.getField("Method-External").setItems (["","Smash and Grab - vehicles", "Smash and Grab - pedestrian", "forced entry", "Unauthorized Keyed", "Other"]);

    break;

    case 'mischief ':

    this.getField("Method-External").setItems (["","graffiti", "Damage", "product a manipulation", "Other"]);

    break;

    case "Cyber Crime":

    this.getField("Method-External").setItems (["","Malware (Virus)", "Phishing", "Others" "]);

    break;

    this.getField("Department-External").setItems (["", "s/o"]);

    break;

    }

    Thank you

    You have a few break statements that should not be there. Try this:

    Switch (event.value) {}

    case 'flight ':

    this.getField("Method-External").setItems (["","grab and run", "shopping cart/basket Walk Out", "Possession", "Consumption", "Other"]);

    this.getField("Department-External").setItems (["","Agro", "Automobile", "Bakery", "Building materials", "Chemical", "Cleaning supplies", "Candy", "Dairy products", "Deli/Bistro", "ELECTRIC", "Electronics", "Farm equipment", "Fashion", "Feed", "Fertilizer"]);

    break;

    cases of "fraud":

    this.getField("Method-External").setItems (["", "credit card", "debit card", "Check", "Coupon", "Counterfeit", "Merchandise Return", "Price Switching", "Self Check-out", "Provider", "Other"]);

    this.getField("Department-External").setItems (["", "s/o"]);

    break;

    case 'flight ':

    this.getField("Method-External").setItems (["", 'threat of concealed weapon', 'Threat from weapon', "Verbal threats", "Acts of aggression", "Other"]);

    break;

    case 'exit and enter:

    this.getField("Method-External").setItems (["","Smash and Grab - vehicles", "Smash and Grab - pedestrian", "forced entry", "Unauthorized Keyed", "Other"]);

    break;

    case 'mischief ':

    this.getField("Method-External").setItems (["","graffiti", "Damage", "product a manipulation", "Other"]);

    break;

    case "Cyber Crime":

    this.getField("Method-External").setItems (["","Malware (Virus)", "Phishing", "Others" "]);

    this.getField("Department-External").setItems (["", "s/o"]);

    break;

    }

  • Unable to increase the Indent/margin left on the value in the drop-down list (no label)

    Hello

    How is it that I can't increase the left margin for the part of the value of the drop-down fields?  Just to clarify, I'm not trying increase the left margin in the setting tab on the page of the object, but the left indent or margin of the value selected in the drop-down list.  The text is just against the left side of the drop-down list box, as you can see in the first picture below, where defence"is.   When I go into formatting, withdrawal of left which cannot be increased from zero.  Any help is appreciated.


    temp.png


    temp2.png


    Alternatively, you can cheat it. It seems to work. Define the field as a text field, and the dash. Then go to the Type of object field and replace it with a drop-down list. This seems to keep the dash.

  • Have the drop-down list boxes become visible depending on the selection in a previous drop-down list box?

    Hi, im doing a form that only shows some options based on the previous selections.

    So far I have buttons which allow a user to select a specific product, and then by using the drop-down combo boxes select some optional features.

    I then have a simple javascript code that bears the name of a product at a price (i.e. the user selects product 'A', the review sections shows priced at $ 99).

    My problem is with additional customization options that depend on previous choices.

    Is it possible to have some drop-down list boxes become visible depending on the selection in a previous drop-down list box? If yes how could I impliment it?

    Currently my best idea is to have a button that could ask the user if he or she had previously chosen a certain selection and then reveal areas of correct drop-down list accordingly.

    Thank you

    Hello

    With a small change I think that the code works as expected. I changed your mainDD.value to event.value, as on the validate event the mainDD.value property cannot be updated as expected.

    script

    this.getField("Dropdown2").display = display.hidden;

    this.getField("Dropdown3").display = display.hidden;

    this.getField("Dropdown4").display = display.hidden;

    Switch (event.value)

    {

    case "a":

    this.getField("Dropdown2").display = display.visible;

    break;

    case "b":

    this.getField("Dropdown3").display = display.visible;

    break;

    case 'c ':

    this.getField("Dropdown4").display = display.visible;

    break;

    by default:

    break;

    }

    end of script

    Hope this helps

    Malcolm

  • 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

  • List drop-down selection trigger change in the text field

    I'm hit a roadblock here. I'm on Adobe Acrobat XI and here's the scenario: I have a list box and a text box.

    Drop-down menu field has 3 caps (A, B, C).

    If A is selected, the text box = 15 default, but has the ability to change in the text box.

    If B or C is selected, the text box = 0 or "by default, but it has the ability to change in the text box.

    If I use an if/then with a .value, I'll be able to get the numbers to work, but do not have the ability to edit and keep them there. If I enter another number in another area, the JavaScript code will run and change the text box to 0 or 15.

    Any help would be greatly appreciated.

    Thank you

    Instead to use script logic for the text field, use the drop-down validation script. In this way, that it only will be triggered when you change the value in the drop-down list field, not when you change any field in the file (as the calculation script).

Maybe you are looking for

  • T8200: Where physical access to the wireless network adapter

    Hello I bought a Tecra 8200. The internal WLAN card does not work. When I activate it with the button on the front of the laptop, nothing happens.The card is not recognized by WinXP-> means that it does not appear in Device Manager. It seems that the

  • Second limit of hard disk for P7-1206

    I have a P7-1206 Pavilion comes with a 2 TB hard drive.  I would like to install a second hard drive to use for multimedia files.  What is the largest hard drive that I can install?  I guess it will take a 2 TB drive but if I can go higher?

  • Edimax in LabVIEW IP camera

    Hello I'm working on a better solution for my project. I use an Edimax IP camera (model IC - 3110p) I currently streaming using VLC X asset control and then call the node to add the target and play the stream. I was able to find the raw video stream,

  • The combination of clips Director windows

    I can't combine clips in windows movie maker, I highlighted several clips and went on the clips tab to combine, but it will not combine them.  I went to the windows help and have not been able to figure this out, if anyone can help would be great

  • Hard drive error screen

    I own a HP Pavilion DV6 - 6160ev. Although I run the hard drive Test and pass the three tests (SMART Check, DST DST short and long), the hard disk error screen keeps coming back. What could be the problem? Thank you Panagiotis