Setting the Default Value for a dynamic select menu

Hi I have a php page with 2 forms on it, one feeds the other to achieve a drill down (manufacturer > model). In the second select menu I have a default static value "Select Aircraft Model", I want to set a value for the first dynamic select menu to read "Select Aircraft Manufacturer". When I add a static value to my list it tells me I alreay have a dynamic behavior on this menu and to choose a different one. I have included the code for both menus. Thank you in advance, I know this must be a stupid question, but it's got me stumped.
Tom
//This is the menu I want to add the default static value to//
<td width="667"><select name="airMake" style="width: 200px;"onchange="this.form.submit();" id="airMake">
        <?php
do {
?>
        <option value="<?php echo $row_rsAirManufacturer['aircraft_manufacturer']?>"<?php if (!(strcmp($row_rsAirManufacturer['aircraft_manufacturer'], ((isset($_POST["airMake"]))?$_POST["airMake"]:"")))) {echo "selected=\"selected\"";} ?>><?php echo $row_rsAirManufacturer['aircraft_manufacturer']?></option>
        <?php
} while ($row_rsAirManufacturer = mysql_fetch_assoc($rsAirManufacturer));
  $rows = mysql_num_rows($rsAirManufacturer);
  if($rows > 0) {
      mysql_data_seek($rsAirManufacturer, 0);
      $row_rsAirManufacturer = mysql_fetch_assoc($rsAirManufacturer);
?>
      </select>
      </td>
  </tr>
</table></form>
    <form action="quoteResult.php" method="post" name="quoteForm">
      <table width="100%" border="0" cellpadding="5px">
        <tr>
          <td width="260"style="color: #000; text-align: right;">Aircraft Model:</td>
          <td colspan="2"><span id="spryselect2">
//This is the menu that works correctly//
            <select name="airModel" style="width: 200px;" id="airModel">
              <option value="" <?php if (!(strcmp("", ((isset($_POST["airMakeField"]))?$_POST["airMakeField"]:"")))) {echo "selected=\"selected\"";} ?>></option>
              <?php
do { 
?>
              <option value="<?php echo $row_rsAirModel['aircraft_model']?>"<?php if (!(strcmp($row_rsAirModel['aircraft_model'], ((isset($_POST["airMakeField"]))?$_POST["airMakeField"]:"")))) {echo "selected=\"selected\"";} ?>><?php echo $row_rsAirModel['aircraft_model']?>Select Aircraft Model</option>
              <?php
} while ($row_rsAirModel = mysql_fetch_assoc($rsAirModel));
  $rows = mysql_num_rows($rsAirModel);
  if($rows > 0) {
      mysql_data_seek($rsAirModel, 0);
      $row_rsAirModel = mysql_fetch_assoc($rsAirModel);
?>
              </select>

Change this -
<select name="airMake" style="width: 200px;"onchange="this.form.submit();" id="airMake">
to this -
<select name="airMake" style="width: 200px;"onchange="this.form.submit();" id="airMake">
<option value="-1">Select Aircraft Manufacturer</option>
Then if the value of 'airMake' is -1 you know that no choice was made.

Similar Messages

  • How to set the Default values for Info Objects in Data Selection of InfoPac

    Hi All,
    Flat file Extracion:
    How to set the Default values for Info Objects in Data Selection Tab  for Info Package
    ex: Fiscal Year Variant  Info Object having values 'K4' 'Y2' etc  in Flat file
    Initially  default value(not constant)  for this info Object value should be 'K4'  in Info Package
    If I set data selection value for this info object K4 it will retreive records with this selection only? how to handle
    Rgds,
    CV

    Hi,
    suppose as your ex. if you are having fiscalyear variant in the dataselection tab then specify K4 in the from column, again the ficalyearvariant row and click on insert duplicate row at the bottom . you will get another row . In that enter Y2 in the from column. now you can extract K4, y2 values .
    haritha

  • SRM 4.0- How to set the default values for product type (01) only for SC

    The radio button “Service” should not be visible.
    Also for search help (e.g. search for internal products) where a search should only be possible for product type 01 (goods). The system should not display the product type and internally always search for goods only.
    How to set the default values for product type (01) only for SC
    We needs to use Search help BBPH_PRODUCT which having parameter PRODUCT_TYPE
    Here we can set defalut value 01 but it is not correct one since same search help is using several places.
    We need to limit the search help results only for SC.
    Kindly help out me ASAP.

    The easiest way to set defautl values is to edit the batch class.
    Goto the characteiristic and go to update values.
    In here you probably have something like 0 - 100 as a spec range.
    On the next line enter the default value within this range.  At the end of the line, click in the box in the column labelled "D".  This indicates the defautl value for the characteristic.
    If you need to you can do this in the material classification view as well.
    Just to be clear, these values will only show up in the batch record.  You can not have defautl values in resutls recording screens.
    FF

  • How to set the default values for print options

    Hi all,
    We can set the default value for print options, just like Logical destination、numbers of messages、print immediately and so on, so where we should to maintain these default?

    Hi Sandy,
    This can be done by an abaper by making changes in the driver program. The Driver program feeds all the data which u have mentioned for printing.
    if the driver program is standard. copy to an z type and make modification on printer settings on the driver program code.
    this will surely solve the issue.
    Regards
    Gunaseelan

  • How to set the default values for fields

    Hi all,
    How to show the default values without changing the existing code in the CO for the seeded page.
    I have requirement like one drown box in that three values are there. On page load the item is empty , but i have to show first value as default value. Is this possible through personalization..
    Can any body have idea pls give some suggession.
    Thanks
    Uma

    Considering you don't want to go for controller extension..
    A way is to use java script in personalization.
    Simply create a RawTextBean using personalization and add the java code to change the properties.
    Java script plan:
    Get the handle of the items to change (like here drop down)
    selectTags=document.getElementsByTagName('select') --gives list of all the select tags in the page
    get ID of the select tag whose value you want to change (loop throug selectTags array).
    or get it directly by getElementsByName method or getElementsByID mETHOD.
    Say its handle is changeItemID.
    changeItemID.selectedIndex=2
    Overview of script
    <SCRIPT type="text/javascript">function _checkLoad(eventXX){
    --yOUR CODE FOR GETTING handle Of the select item whose value is to be changed,goes here...
    changeItemID.selectedIndex=2
    }</SCRIPT>

  • How to set the default value for page item in report

    Hi Gurus
    I currently i have company name as page item in one of my report screen ,but it is displaying the value for company name in its drop down column ,but i want to make it "*ALL* as default after the query result ",this is user requirement ,please share ,how can i make it ,is it possible ??,thanx in advance
    thanx
    Pratap

    Hi,
    I don't think this is possible. You can of course use a parameter to select the page item and default the parameter but then the user will have to rerun the report to see other pages items.
    Rod West

  • Select MULTIPLE default values for a multiple selection list box based on another field in Infopath 2010

    Hello there - Before I explain my issue, I would like to point out that I have reviewed some other discussions on selecting default values for multiple selection listbox. But my issue is specific and different, and not answered by any of the discussions
    I visited.
    I have a multiple selection list box (say for example all countries in the world as values), and I would like to pre-select or setup multiple default values (say five countries) based on some criteria that I query from MS SQL database table.
    I know we can go to Data | Default Values option to setup one or many default values for multiple selection list box. When I enter the default values manually this works. I also right click the field under the Multiple-Selection List Box group, then select
    Add another Value Below and set the Default Value for this field to setup multiple default values.
    However, if I reference a field (either an infopath field or a field from SQL database) I am not able to setup multiple default values. Infopath automatically selects the last field I selected for all instances and in the end I am able to see only one
    default value selected instead of many. How to fix this problem? Why would infopath allow multiple default values when we enter it manually but not when we reference some fields?
    Please let me know if you need more info. Appreciate your help.
    Thanks!

    Hi redhotc,
    According to your description, my understanding is that you want to set multiple default values for a multiple checkbox list in InfoPath form.
    I did a test with SQL database table. I set three default values for the checkbox list by adding three values field under the group field(Data->Default values), each value field is for a default value. Then publish it to my SharePoint site, everything
    was fine.Please have a try as the below link:
    http://www.bizsupportonline.net/infopath2010/pre-select-items-multiple-selection-list-box-infopath-2010.htm
    Note: if you are using SQL databse table, you may need to enable ‘Allow cross-domain data access for user form templates that use connection settings in a data connection file’ in CA. More information, please refer to:
    http://answers.flyppdevportal.com/categories/sharepoint2010/sharepoint2010customization.aspx?ID=418b9423-a96c-4e5e-91f9-6a1b010ebb69
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • How to set the default value of a database column to NULL

    Hello,
    I want to set the default value of a column (VARCHAR2(20) to NULL, nut I cannot figure out to do this. I tried the following editing the offline table with JDeveloper:
    Default Value : <empty> -> On database NULL
    Default Value: '' -> On database ''
    When I create a new column, there is no default value on the database side and when I open the tabe properties in the database navigator I can see that the default value is (null). This is what I want to see in the other column as well. I don't know why sometimes a default value is visible on the database side (when generating form offline tables to database tables) and sometimes not.
    Perhaps sombody can bring some light in this issue.
    Thanks Thomas

    Hello Shay,
    I have the impression that you don't understand my problem. So here step by step:
    1. Create a offline Table TEST with one column TEST: VARCHAR2(20). nullable=true, no default value.
    2. Generate the table to the database
    3. When you look at the table properties (columns) with the database navigator the following information is displayed (sorry for the formatting):
    Column Name | Data Type | Nullable | Data Default | COLUMN ID| Primary Key | COMMENTS
    TEST | VARCHAR2(20 BYTE | Yes | (null) | 1 | (null) | (null)
    4. Now set the default value for the column TEST in the offline table for example to 'Test'
    5. Generate the table to the database.
    6. When you have a look at the database table, the default value is now 'Test' (as expected)
    7. Now remove the default value of the column TEST in the offline table
    8. Generate the table to the database
    9. When you have a look at the database table, the default value is now NULL (in uppercase letters without parenthesis)
    And this is where the problem starts!
    When you generate the table again with the options "Alter/Manual Reconcile" the default value of the column test is considered to be different! But in fact it should'nt be different because nothing has been changed.
    Best regards Thomas
    Edited by: thmayr on May 28, 2009 9:05 AM
    Edited by: thmayr on May 28, 2009 9:31 AM

  • How to set a default value for a drop down list box and then apply cascading based on the default value in Infopath 2010.

    Hello Everyone
    I have two drop downs. Both are coming from look up fields from two lists. i want to set a default value(first list item) for the first drop down list box and then apply cascading based on the default value for the next drop down list box. I found one article(http://www.bizsupportonline.net/infopath2010/display-first-item-drop-down-list-box-infopath-2010.htm)
    where in i can set a default value but i can't apply cascading based on that default value. Any suggestions would be highly appreciated.
    Thanks
    Ramanjulu Naidu N

    Hey Ramanjulu,
    Take a look at the below article which I believe will answer your question.
    http://basquang.wordpress.com/2010/03/29/cascading-drop-down-list-in-sharepoint-2010-using-infopath-2010/
    Daniel Christian (MCTS)

  • Can we set a default value for the container variable in BPM?

    Can we set a default value for the container variable.?
    Suppose if i have a loop step and i have given a container variable i=5 as end condition.What value will it take during its first execution?Can we set the value for container before a recieve step?

    Hi
    Define Container Variable of Type integer and Category Simple Type .Use Condtion in Loop.
    In Container Operation Step Assign value and Use Expression to
    Increase or Decrease Valus according to your operation.
    look Pattern 4 in this blog to understand Container Operation
    /people/sharathchandra.girmaji/blog/2008/09/11/bpm-with-patterns-explained-part-1

  • Setting a default value for SQL based LOV

    Hi There,
    Is there a way to set the default value in an LOV. Like lets say the LOV gets distinct to_Char(date_field,'YYYY') from a table. I want that the highest year is the default value. Currently, since I have the null option also, when the page loads, the lov is always null. I need to change it manually.
    Thanks,
    Sun

    You can easily set the dynamic item defaults
    http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21674/bldapp_item.htm#HTMDB28287
    for example select the default type as PL/SQL Function Body and enter the following code
    declare
    v_return date;
    begin
    select max(date_field) into v_return from your_table;
    return to_Char(v_return,'YYYY');
    exception when others then
    return null;
    end;

  • How to set a default value for particular field in SRM PO Portal

    Dear Gurus,
    Im desparetly need a help in web dynpro on how to set a default value for a field(flag) in PO header tab in portal.
    My requirement is whenever the user press the edit button in PO screen,automatically a flag field should be set as abap_false.
    I dont think this will handle in check badi or change badi. i tried this part in onbuttonpressed overwriteexit in CNR_VIEW views,i can get the function EDIT in debugging mode,but dont know how to proceed further.....
    Many of them suggested to go with get attribute and set attribute for changing any particular field in web dynpro,but im not very familiar in using those get and set attributes.I request you people can give me sample code on how to identify my target field in the node and set the values while pressing EDIT Button.
    Thanks in advance...
    Regards,
    Sathish

    Dear Laurent,
    Thanks for your response,
    But i searched in enhancement spot of WD_BADI, but couldnt get the exact way to change the coding,
    My real requirement is, that particular flag should be enable and disable dynamically by checking a condition in my header values.So in that case i dont know how to proceed further to handle in the PO screen.
    Kinly guide me how to get the particular node of field in the Purchase order screen.
    Thanks you in advance,
    Sorry for the inconvenience if any
    Regards,
    sathish

  • Cannot set the default value of an item in the detailed table

    Hi,
    I have Master-Detail group, both are Table formats.
    I need to set the default value of an item in the details row to the value of an item in the selected row in the Master table.
    I tried Default Display Value=#{row.MasterItem}, but it seems it is trying to access current details row instead of the Master.
    I tried #{bindings.MasterGroupColumnName.inputValue}, but it does not work.
    Any ideas
    Thanks in advance
    Mohamed

    I think I now what I'm doing differently, I had the "New Rows" JHS property of the detailed table group "empty" instead of the default "2" value.
    It seems that "Default Display Value" expression works only for the new records specified in the "New Rows" property. But when I try to "Add" new record using the "Add Row" button, the new record inserted does not have the default values generated, only has values populated for the items of the FK (in the view link) but not the ones set through the property.
    I guess in a nutshell, how I can get the details item to behave like the FK columns?
    Thanks much
    Mohamed

  • Can I set the default locale for jvm

    Hi,
    Can I set the default locale for jvm?
    How to do it?
    Pan

    My windows default locale is chinese .I have thought of your opinion. But in
    windows nt , if I change the locale , all the environment will be
    destroyed(just like reinstall it , it's difficult for me) . So , Is there
    any other approach?
    Dimitri Rakitine <[email protected]> wrote in message
    news:[email protected]...
    Did you try to change the locale in the Windows control panel?
    (Control panel -> Regional Options -> Your locale)
    Pan YangBin <[email protected]> wrote:
    I have tried changing this system property and other properties such
    as -Duser.language=en -Dfile.encoding=Cp1252 , but all these properties
    did
    not changed, you can get this infomation from the log file .Maybe these
    system properties are readonly.
    Thanks very much.
    Pan
    Chris Halstead <[email protected]> wrote in message
    news:[email protected]...
    Try adding -Duser.region=US to the java command line used to start
    WebLogic...
    -chris
    "Pan YangBin" <[email protected]> wrote in message
    news:[email protected]...
    Hi,
    The problem exists in my project still exist.That is it.
    When I did not set weblogic.jsp.encoding to GB2312 in my web
    application(web.xml), and when the jsp file contain's chinese , the
    output
    will be error(error chinese) .And when I did not set it , the output
    is
    correct, but when I use request.getParameter("SomeFormElement")(theelement
    inputed chinese), the return value is error(still chinese error).And
    when
    I
    am in windows nt english version and do not set this property, all
    these
    two
    problems dispear. And I try to compare the java files those were
    generated
    by weblogic from the jsp file , there is only two additional clause
    in
    the
    java file. That's it:
    ((weblogic.servlet.jsp.JspWriterImpl)out).setEncoding("GB2312");
    response.setHeader("Content-Type", "text/html; charset=GB2312");
    (the web.xml has <context-param>
    <param-name>weblogic.jsp.encoding</param-name>
    <param-value>GB2312</param-value>
    </context-param> to be set
    So, I think maybe it works well if I change the default locale toenglish.
    And unfortunately, your method is also failed.(I have to use weblogic
    in
    chinese environment)
    Would you please help me to solve this problem?
    Pan
    Dimitri Rakitine <[email protected]> wrote in message
    news:[email protected]...
    Try java ... -Duser.language=en ...
    or mode con cp select=437 in the command prompt before running
    weblogic.
    Pan YangBin <[email protected]> wrote:
    I'm using weblogic server 5.1 sp6 in chinese environment, and I
    want
    weblogic compile my jsp with en_us locale . So I can't use
    Locale.setDefault(new Locale(...)) to set the default locale ,butI
    really
    want someway configure.
    Pan
    Dimitri Rakitine <[email protected]> wrote in message
    news:[email protected]...
    Locale.setDefault(new Locale(...)) ?
    Pan YangBin <[email protected]> wrote:
    Hi,
    Can I set the default locale for jvm?
    How to do it?
    PanDimitri
    Dimitri
    Dimitri

  • How to set the default value of selectOneChoice

    Hi All,
    I have two selectOneChoice(soc1 and soc2) in two respective pages with the same datacontrol.Now i need to set the default value of soc2 as per the value selected in soc1.
    For eg:-
    if user has selected a value in soc1 say "Bag" in the list then it should set the default value in soc2 as "Bag" when the second page loads.As both the selectOneChoice has been created using same data contol.
    How can i achieve this?
    Please suggest.

    Hi PR/Suresh,
    Thanks for your reply.
    My soc1 shows the employeeId like 100,101,102,103 but it holds the value as employeeName like Navn,Joy,Steve,Mark. I have used valuechangeevent to get the current selected value from soc1 but when i set the value in soc2 in its set property then the log says :-
    *<SimpleSelectOneRenderer> <_getSelectedIndex> Could not find selected item matching value "Navn" in RichSelectOneChoice[UIXEditableFacesBeanImpl, id=soc2]*
    My jspx page code of soc2 is :-
    <af:selectOneChoice binding="#{backingBeanScope.backing_temp2.soc2}"
    id="soc2"
    label="#{bindings.FirstName.label}">
    <f:selectItems value="#{bindings.FirstName.items}"
    binding="#{backingBeanScope.backing_temp2.si2}"
    id="si2"/>
    </af:selectOneChoice>
    and in my bean where i am accessing the value from valuechangeevent from soc1:-
    public void getValue(ValueChangeEvent valueChangeEvent) {
    BindingContext bindingContext = BindingContext.getCurrent();
    oracle.binding.BindingContainer bindings = bindingContext.getCurrentBindingsEntry();
    //for iterator name click binding tab in the jsf page
    DCIteratorBinding iter = (DCIteratorBinding) bindings.get("Employees1View1Iterator");
    int curIndex = (Integer)valueChangeEvent.getNewValue();
    Row datRow = iter.getRowAtRangeIndex(curIndex);
    String name = (String)datRow.getAttribute("FirstName");
    System.out.println("the new value is"+name);
    RequestContext requestContext = RequestContext.getCurrentInstance();
    requestContext.getPageFlowScope().put("value", name);
    and then i am setting it to the soc2 in backing bean :-
    public void setSoc2(RichSelectOneChoice soc2) {
    this.soc2 = soc2;
    RequestContext requestContext = RequestContext.getCurrentInstance();
    String val = requestContext.getPageFlowScope().get("value").toString();
    this.soc2.setValue(val);
    In this error i can predict that it is not able to find the 'Navn' in the list of soc2 because in the list it has employeeId which has corresponding value as name of that employee but how do i set the value in soc2 then.
    *<SimpleSelectOneRenderer> <_getSelectedIndex> Could not find selected item matching value "Navn" in RichSelectOneChoice[UIXEditableFacesBeanImpl, id=soc2]*
    Any ideas??
    Thanks

Maybe you are looking for

  • How do I group songs under one album, please?

    OK, so I iTunes works better than Windows media player for my set up with Windows 7 Ultimate .... BUT it 'took over' the Media Player library and put some tracks as separate entries - so, for example, I have one album of Rod Stewart in 6 different pl

  • Unknown error while syncing -50

    Just a quick question if no answer thats fine but I just got a new iPod Classic 120GB and just went to sync it for the first time with my library and got an error saying iPod cannot sync because an unknown error occurred (-50). I had this problem wit

  • Including CMYK profile in InDesign PDF Export

    Hi, I'm trying to export from InDesign a pdf file, which includes embedded profiles both in RGB and CMYK images. There are two linked images in my INDD layout, one embedded with RGB profile and another with CMYK profile. In Output I have the settings

  • Any Other Dinosaurs Out There?  Need PhotoDeluxe Business Edition 1.0 Help (Restore after Crash)

    I'm still using BE 1.0 and very happy with it, but in rare instances it crashes. It leaves behind a file named ~PDTnnnn.tmp in my "...\Local Settings\Temp" folder. Is it possible to restore the session from this file?

  • Multiple Listing for One Artist

    First, click on the link to view a picture: http://www.freeimagehosting.net/uploads/bf3a7e5fdb.png So why are the Minutemen listed four times in a row when all my Minutemen MP3's are a) ripped from my own CD's, and therefore b) uniformly and tagged?