Don't allow to select duplicate entries from drop-down fields, JS pls.?

Hello
I have 3 drop down fields in my_sub_form, say, my_country_1, my_country_2 and my_country_3. All drop down field's list boxes are populated with 10 country names, say, US, Canada, Spain, Germany, France...
Say, user selected US in my_country_1 drop down field, again user is TRYING to select same entry as US in my_country_2 field======> Here at this point, as soon as user selected as US in my_country_2's droppped down list box=====> immediatley, I need to throw warning message to the user and make the my_country_2 as "" BLANK.
Basically, my form should not allow the user to select the DUPLICATE entries in these 3 drop-down fields, all the 3 should be DISTINCT.
If i write JS in EXIT event  of my_sub_form, its working fine, but not user friendly, it kind of late.
Hence we want to have INSTANT alert to user AS SOON AS user selects a duplicate entry in any drop down field
I tried to put some JS in CHANGE event of my_country_1 and my_country_2, but not working
Pls. provide me some JS and the event name, object name
Thank you

you could put in the exit event of the my_country_1 list:
if (this.rawValue == my_country_2.rawValue || this.rawValue == my_country_3.rawValue)
xfa.host.messageBox("You cannot choose the same country");
this.rawValue = ""
and then put the same in the other dropdowns but change the names.

Similar Messages

  • How to populate multiple text boxes by selecting a value from drop down

    I apologize in advance if this is redundant, but I have searched this forum relentlessly to no avail. I have a form  connected to an MS Access database. The database is linked to another datadase on an Advantage server. This is dynamic data that has an ODBC driver allowing to link access tables to the Advantage data. Macros on access updates the table being used on this form. The livecycle form connects to the access data via a DSN on a machine that uses acrobat (not reader). This is a physician office, this form should expedite ordering radiology tests on patients. The plan is to use a drop down to select a chart number that will trigger several text boxes to populate dynamically with the corresponding demographic values like name, age, insurance etc.
    Using a data drop down I am able to select the chart number. When I used the example from the office supplies database, so that a button will trigger the event with the following code:
    if (Len(Ltrim(Rtrim(SelectField.rawValue))) > 0) then
    $sourceSet.DataConnection.#command.query.commandType = "text"
    $sourceSet.DataConnection.#command.query.select.nodes. 
    item(0).value = Concat("Select * from OfficeSupplies Where ID = ", Ltrim(Rtrim(SelectField.rawValue)) ,"") 
    I recieve a syntax error, despite adjusting quotation since I am using text rather than numeric fields.
    My question is the following:
    Is there a simple javascript that I can use to populate these text boxes (which may be read only but would be better if it allows user input)? Or does anyone recommend an alternative method? I would be happy with a link that solves this problem if someone can provide. I am somewhat familiar with js but open to any suggesstion.
    Thanks
    PS this form could also be linked to a Sequel database if that offers an advantage.

    The View object API has a setQurery() method that you can use to set the query as needed before executing it via executeQuery(). You can do this in a custom Application Module method exposed to its client interface and bound to the binding layer. You can call this method from your backing bean on a value change listener.

  • Remove default entry from drop down

    How can i remove the default entry from a dropdown element?
    Florin

    Hi Florin,
    If you are using DropDownByKey, just setting the current selection to some key value will remove the default blank entry.
    wdContext.current<node name>Element().set<attribute>(<key value of the selected data>);
    This will set the value corresponding to this key as the currently selected one in the dropdown and along with this, the default entry will also disappear
    Hope this helps,
    Best Regards,
    Nibu.

  • I am needing to send a document that can be filled in from drop down fields I have created.  After the document is filled and signed I need the form to be locked from further changes

    I am in need of help with someone being able to fill in and sign a form in Reader that I created in Adobe Acrobat XI Pro.  After that document is sign I need it to be locked from further changes.  Can someone please help

    Hi Suzette,
    Once the document is digitally signed it will not allow further changes.
    You might want to check the solution mentioned in the thread: Re: Convert editable PDF to read-only when sent in an email - JavaScript
    Regards,
    Rave

  • Remove duplicate entries from dropdownlist in web dynpro abap

    How to remove duplicate entries from dropdownlist in web dynpro abap? Can someone please help me
    I have maintained the data in the z table wherein the records of particular fields are repeated but when i show that record in the Web Dynpro application dropdown list, the user should only be able to view the unique data for selection of that particular field.

    Hi,
    try this code in init method.
    use the
    Delete adjacent duplicates.
    <set the table>
    select <f1>  from <table> into TABLE <Itab> whre <condition>.
       DELETE ADJACENT DUPLICATES FROM <Itab> COMPARING <f1>.
         lo_nd_vbap->bind_table( new_items = <itab> set_initial_elements = abap_true ).

  • Trick to remove duplicate entries from tables ?

    hi.
    i have 53tables which are having duplicate entries and names of all 53 tables r listed in top_t table ?
    can any1 provide me solution to show and if possible ask for remove of those duplicates entries from each table if required ?
    daily i am removing duplicates manually ....its too tedious now !
    can any1 help me out ?

    Well, I suppose if the duplication is such that
    SELECT DISTINCT * FROM tablename;gives you the required result, then you could have a procedure that made a copy of the table, deleted/truncated the original, then inserted the distinct values back into it.
    In 10g you could even use flashback to avoid the temp copy - but it also means you can't use TRUNCATE so whether it's any more efficient I'm not sure. But just for fun and since it's urgent:
    CREATE OR REPLACE PROCEDURE dedupe_table
        ( p_table_name user_tables.table_name%TYPE )
    IS
        k_start_timestamp TIMESTAMP := SYSTIMESTAMP;
    BEGIN
        SAVEPOINT start_of_dedupe;
        BEGIN
            EXECUTE IMMEDIATE 'DELETE ' || p_table_name;
        EXCEPTION
            WHEN OTHERS THEN
                ROLLBACK TO start_of_dedupe;
                RAISE_APPLICATION_ERROR
                ( -20000
                , 'Error deleting ' || UPPER(p_table_name) ||
                   CHR(10) || DBMS_UTILITY.FORMAT_ERROR_BACKTRACE
                , TRUE );
        END;
        BEGIN
            EXECUTE IMMEDIATE
            'INSERT INTO ' || p_table_name ||
            ' SELECT DISTINCT * FROM ' || p_table_name || ' AS OF TIMESTAMP :b1'
            USING k_start_timestamp;
        EXCEPTION
            WHEN OTHERS THEN
                ROLLBACK TO start_of_dedupe;
                RAISE_APPLICATION_ERROR
                ( -20000
                , 'Error repopulating ' || UPPER(p_table_name) ||
                   CHR(10) || DBMS_UTILITY.FORMAT_ERROR_BACKTRACE
                , TRUE );
        END;
    END dedupe_table;
    SQL> select * from wr_test;
          COL1 C C
             1 A B
             1 A B
             2 C D
             2 C D
    4 rows selected.
    SQL> BEGIN
      2      dedupe_table('WR_TEST');
      3  END;
      4  /
    PL/SQL procedure successfully completed.
    SQL> select * from wr_test;
          COL1 C C
             1 A B
             2 C D
    2 rows selected.I make no claims for robustness, efficiency or human safety.
    Edited by: William Robertson on Sep 24, 2009 7:12 PM

  • Deleting Duplicate entries from Internal tbale

    Hi All,
    I have used this code to delete duplicate entries from an internal table.
      DELETE ADJACENT DUPLICATES FROM IT_KOSTL COMPARING KOSTL hours.
    After this statment, still the internal table will remain with a duplicate row.
    Earlier table content before the delete statement:
    Lno  KOSTL                PRCTR                       hours                      hours1 
    1    2081010205     0000208101                 5525.000          1574.500
    2    2081010105     0000208101       105162.000     73854.750
    3    2081010105     0000208101       105162.000     73854.750
    4    2081010205     0000208101        5525.000     1574.500
    The Table gets modified after execution of DELETE statement as follows.
    Lno  KOSTL                PRCTR                       hours                      hours1 
    1    2081010205     0000208101                 5525.000          1574.500
    2    2081010105     0000208101       105162.000     73854.750
    3    2081010205     0000208101        5525.000     1574.500
    Why the line 3 is still present in the table?
    I hope as per that syntax, this line too should get delete.... Is it right?
    Basically i would like to delete both line 3 and line 4 from....
    How to resolve this issue?
    Please help me out....
    Regards
    Pavan
    What might be the reason?

    >
    Pavan Sanganal wrote:
    >   DELETE ADJACENT DUPLICATES FROM IT_KOSTL COMPARING KOSTL hours.
    > Why the line 3 is still present in the table?
    >
    > I hope as per that syntax, this line too should get delete.... Is it right?
    >
    Let me answer you all doubts.
    Why the line 3 is still present in the table?
    Actually it's not 3rd line, it's 2nd line.3rd line were deleted.
    when delete adjecent duplicates trigger than it would delete lower line(3rd in your case) not upper line.
    I hope as per that syntax, this line too should get delete.... Is it right?
    NO.

  • How to select alternate entries from the database table

    Hi Experts,
    can u help me, how to select alternate entries from the database table.
    Thanks

    As there is no concept of sequence (unless there is a field specifically included for the purpose), there is no meaning to "alternate" records.
    What table do you have in mind, what data does it hold, and why do you want alternate records?
    matt

  • TS4062 how do i remove duplicate entries from my phone directory?

    question; how do i remove duplicate entries from my phone directory?

    go to your contacts icon and choose the one you want to delate
    Choose edit, top right and go (scroll) to the bottom of the page and press delete contact

  • Allow Custom Text Entry for Drop down not working For Dynamic form

    Dear All,
    In drop down field Allow custom text entry is working fine if the form is save as a static pdf form file.But if the form is save as a Dynamic pdf form file it is not working.I can enter custom text in drop down field but after filling it up when I click on next field the text from the drop down is disappearing.
    If any body can please help me to solve this problem.
    Thanks a lot in advance
    Regards
    Rakesh

    Dear Jimmypham,
    Thanks a lot for your quick response.But it's not working for me.I have even tried with a form having only single field and save it as a dynamic pdf file.In that form also it's not working.The text which I have entered is disappearing when I click outside of this field.
    Can you please help me to find out the solution for this problem.
    Regards
    Rakesh

  • Multiple selection from drop down : NWDS7.0 SPS18

    Hi Team,
    How can achieve multiple selection from drop down? I am working on NWDS7.0 SPS18. I have known the concept of item list box... is that's the only option?.
    Is it possible to make it as filter option that we have in our Microsoft excel.
    Customer wants select either/all options @once from drop down.
    TIA,
    Vanita K

    Hi,
    Create a node with cardinality 0-n and selection property set to 0-n
    Create a table UI element and bind this node as a datasource to this table.
    Set the selection mode  property of this table as auto or multi
    Once this is done, populate the node with some data elements.
    When you run the application, you will be able to select multiple rows from the table.
    To get the selected rows, use below code on the action of some button
         wdComponentAPI.getMessageManager().reportSuccess("Selected rows are");
         int n = wdContext.nodeEmployeeData().size();//size of node binded with table
         int leadSelected = wdContext.nodeEmployeeData().getLeadSelection();
         for (int i = n - 1; i >= 0; --i)
              if (wdContext.nodeEmployeeData().isMultiSelected(i) || leadSelected == i )
                   IEmployeeDataElement employeeDataElement = wdContext.nodeEmployeeData().getEmployeeDataElementAt(i);
                   wdComponentAPI.getMessageManager().reportSuccess("ID: "+employeeDataElement.getID()+"Name: "+employeeDataElement.getName());
    For adding sorting and filtering functionality to the table follow the article
    [WDJ - A Generic Java Class for Filtering Web Dynpro Tables|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/60d5b593-ba83-2910-28a9-a7a7c7f5996f]
    Regards,
    Amol

  • I have created a PDF form with multiple drop downs, all with the same drop down values. When I select a value from 1 of the drop down fields, it replicates in all of the others - which I do not want. How can I fix this?

    I have created a PDF form with multiple drop downs, all with the same drop down values. When I select a value from 1 of the drop down fields, it replicates in all of the others - which I do not want. Can I fix this?

    I'm fairly new to this, but I think it has to do with the way you have the drop downs named. Did you copy one then keep pasting it in each field? If so, that is the problem. You should rename each one with a different number: Dropdown1, Dropdown2, etc. I think that might solve the issue.

  • How to capture selected value from drop down by index

    Dear friends,
    i want to capture the value of select value from drop down by index, for eg if  select air france, how to capture , could any one please let me know
    Thanks
    Vijaya

    Hi Vijaya,
    You can get the value of selected from drop down as below
    Check out the event handler method attached to Onselect event of the ui element drop down by index , if no event is associated, then create an event and attach to the drop down list
    Now you will be having the CONTEXT_ELEMENT in the WDEVENT parameter
                   data lo_element type ref to if_wd_context_element.
                   lo_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT').
    Now, you can get the static attribute value of selected  drop down value & let us say your drop down list values are populated from context node 'ND_DRP_DOWN'
                   data ls_data type wd_this->element_nd_drp_down.
                             lo_element->get_static_attributes(
                                       importing
                                       static_attributes = ls_data ).
    Hope this helps you.
    Regards,
    Rama

  • Restrict Date rule selection from drop down

    Hi all,
    I am using date type srv_cust_beg and srv_cust_end.
    For date type srv_cust_beg i have assigned date rule Today+time.
    For date type srv_cust_end i have not assigned any date rule as consultant should fill this manually.
    My requirement is that consultant should enter the dates manually and they should not select the date rule from the drop down for srv_cust_end.
    For the date type srv_cust_end, we can see todaytime date rule from drop down as this date rule is assigned to srv_cust_beg.
    Is there any possiblity to restict the drop down selection?
    Regards,
    Raj

    Hi,
    The drop down is due to the Date Rule assigned to your Date Profile.
    Since all those 3 date rules are assigned to your Date Profile, you are seeing all those 3 date rules in the drop down.
    Thx,
    Waseem.

  • Hide id from drop-down list at the top of the detail tab

    Hello Nakisa experts!
    I have one more question about Nakisa OrgChart 4.0 SP 1.
    How can I hide position and org unti id from drop-down list at the top of detail tab, see picture below:
    Thanks in advance.

    I'm not sure you're going to be able to change this.  I think (but I'm afraid I don't know for sure) the section is defined by \WEB-INF\uitemaplates\com\nakisa\manager\omg\ui\subucs\sectionDesigners\DetailHistoryButtonSectionSubUC.xhtml, which after a quick search through the application looks as though it might be populated by a NakisaTrollBin.jar ... which isn't really something you should be looking to edit.
    Nakisa do often write in various settings that can allow features to be tweaked and enabled/disabled.  It could be that there's something you could add into SettingsResources to apply the change you require, but you would need to contact Nakisa about this as they don't document all of these options.
    All this being said I would query why this is being done.  It is not uncommon to say have multiple positions with the same name - e.g. HR Administrator might exist in several org units.  If you are looking through several identically named org units or positions, the unique identifier is going to be the object's ID.  As such it seems most logical to me to keep the ID in the history to allow a user to discern the difference between identically named positions/org units.
    Regards,
    Stephen.

Maybe you are looking for

  • Changing Sales Order from using Sales Order Stock to Std Unrestricted

    Hi We have set up some materials to default to an Item Category/Schedule lines that creates the Sales Order with relevance to Sales Order Stock. However in some instances we need to change the Sales Order to a Std Item Category that just uses Unrestr

  • Macbook Pro 10.6.8 keeps freezing

    This has started occuring more and more frequent... it happened maybe once a week 5 months ago, now it happens almost twice everyday. The screen will just go black, and i'll have to turn it off and turn it back on again. Once i do I get this message

  • 3d menu is grey(not clickable)

    Hey guys, I can't select the 3d menu in Photoshop CS6 Extended, it stays always grey. I know this problem was already answered many times before but nothing seemed to work for me. I've selected RGB and 8 Bit, newest drivers for my ATI Radeon Mobility

  • Installation Error: DeviceFamilyNotSupported.

    Hello Flash Builder gives me "Installation Error: DeviceFamilyNotSupported." when im trying to debug application on Iphone 4 (ios 6) Can't find any info about this topic. Same application works well on iPad 3 (ios 5) Any suggestions?

  • IPhoto - unwanted images imported

    Images that were on my iMac were imported into iPhoto when I was turned on the "Look up places" function. The locations of where my photos were taken were not showing up on the iPhoto map.  I went to preferences and went to the advanced settings.  I