APEX DA validation using javascript

Hello

APEX 4.2 using (Oracle, 10 anf 11g)

I have a page and check off the items when click on the button "SUBMIT" using Javascript.

for example.  I have a 10 page. P10_item1, P10_item2, P10_item3 so on. name of the button is SUBMIT.

Dynamic action: Click-> button-> action-> execute Javascript code

If ($x('P10_item1').value == "| $x('P10_item2').value ==" | $x('P10_item3').value == ") {}

Alert ('required fields can be left blank');

}

else {}

Apex. Submit ('SUBMIT');

}

ALL WORK fine, but I want to add the change of background color (field) if any field above is empty after

Click on submit. I added these to the CSS page

. Highlight-error

{

background-color: #FAE7E7! important;

color: white;

}

so, how can I use this css in my javascript code after warning message please?

Thank you very much.

Kind regards

RI

Hi RI,

(1) put that css for you have created for normal in background

Page-> css-> online

.highlight-ok
  {
  background-color: none !important;
  color: white;
  }

(2) check the else part

if ($x('P10_item1').value == '') { 

        $("#P10_item1").addClass('highlight-error'); 

        alert('Mandatory fields can be left blank'); 

    } else if ($x('P10_item2').value == '') { 

        $("#P10_item2").addClass('highlight-error'); 

        alert('Mandatory fields can be left blank'); 

    } else if ($x('P10_item3').value == '') { 

        $("#P10_item3").addClass('highlight-error'); 

        alert('Mandatory fields can be left blank');
    } else {
        $("#P10_item1").addClass('highlight-ok');
        $("#P10_item2").addClass('highlight-ok');
        $("#P10_item3").addClass('highlight-ok');
        apex.submit('SUBMIT'); 

    }

Hope this helps,

Kind regards

Jitendra

Tags: Database

Similar Questions

  • How to use Javascript to loop through a tabular presentation

    APEX: 4.2.3

    DB: 11 GR 2

    Requirement:

    I have a master form / retail. We will see that master is the order information; Detail is the order lines. Detailed form is tabular

    The detailed form, there is an attribute called 'Line Order Qty' and the user can update this field.

    User can update all rows in the detail forms and change "line Order Qty' for each line. When the user click on 'Save' button on Master form, I have to do below:

    Sum of the 'line Order Qty' for all lines, and compare it to another field called 'Plan Order Qty' on the master shape.

    If sum 'Line Order Qty' > "Plan Order Qty", then it should appear a message with "Are you sure?" with two buttons on the message: OK and cancel.

    If users click on 'OK', the application will proceed and update another field called 'Sum of Order Qty' on the main form and the value set for the sum of "Online Order Qty" for all lines;

    If the user clikc 'Cancel', the application will be paused. The user must come back to change "Line Order Qty", and then try again

    given, I need a popup message when the validation, I think I have to write javascript; However, in the javascript code, I need complete all lines in detail (tabular form) to get the

    The sum of the 'line Order Qty'. Then I can compare the value and to launch the pop message if validation has failed?

    By reading this thread: building the perfect beast: Oracle APEX - Soft Validation using dynamic measurements

    I think I need to create a reference for action (DA) dymaic Javascript expression; However, in Javascript, how do I browse a table?

    Yet once, I need an example of using Javascript to browse tabular forms in the form master / detail.

    I don't know that my question should be raised before; but I can't find a good match of thread.

    Thank you!

    Kevin

    Hi Kevin Zhang,

    Sum of the 'line Order Qty' for all lines, and compare it to another field called 'Plan Order Qty' on the master shape.

    If sum 'Line Order Qty' > "Plan Order Qty", then it should appear a message with "Are you sure?" with two buttons on the message: OK and cancel.

    If users click on 'OK', the application will proceed and update another field called 'Sum of Order Qty' on the main form and the value set for the sum of "Online Order Qty" for all lines;

    If the user clikc 'Cancel', the application will be paused. The user must come back to change "Line Order Qty", and then try again

    given, I need a popup message when the validation, I think I have to write javascript; However, in the javascript code, I need complete all lines in detail (tabular form) to get the

    The sum of the 'line Order Qty'. Then I can compare the value and to launch the pop message if validation has failed?

    Follow the steps below

    Step 1: Change your page - > function and declaration of the Global Variable-> to insert the code below

    (i) f06 is here, the column on which I am looping the f06 column and enters the total variable to the value change in the values of the row that is changed by the user.

    (II) also replace your column with f06 markup on which you want to loop and calculate the total

    (III) assuming that P6_ITEM is the point where you plan_order_qty, replace with your article.

    (IV) SAVE this demand is what happens when OK is clicked, assign the request to process.which you give the floor to a click of the button SAVE the

    function update_order_qty () {
      var line_order_qty_tot = 0;
      $("input[name='f06']").each(function() {
        line_order_qty_tot += parseFloat($(this).val().replace(/,/g,''))||0;
      });
    
      var plan_order_qty = apex.item( "P6_ITEM" ).getValue()
    
      if (line_order_qty_tot > plan_order_qty) {
          apex.confirm('Are you sure?', 'SAVE');
      } else {
          apex.submit( 'SAVE' );
      }
    }
    

    Step 2: Edit the page-> Execute when loading the page-> to insert the code below

    \\calculate the total on change
       $("input[name='f06']").change(function(){update_order_qt();})
    

    Step 3: Change your button Save and put under the Action when the button is clicked

    Action: Redirect URL

    Target URL:

    javascript:update_order_qty();
    

    Hope this helps you,

    Kind regards

    Jitendra

  • How to create the custom using Javascripts in PLM for Agile process validator

    I have already created customized using ASP.Net validators. But now I need to create custom using Javascript validator.

    Please provide me the details

    1. how to create custom validator and where to create?

    2 provide me with code samples for custom validators javascripts

    Thank you

    Floquet

    I am currently using 6.1.1.5

  • problem using Javascript window.open Apex 4.2

    I'm trying to use javascript to open a new window in Apex 4.2

    When the user clicks a button on the item, I want to open the page in a new window

    That's what I coded:

    On the button

    under "the ACTION ONCE the BUTTON has been CLICKED" I select "redirect url".

    then enter this: javascript: window.open ('f? p = A:P: & SESSION.) ") ;  where A is the number of the application and P is the page of the application

    This method works.

    Click the button and a new page opens

    the problem is that the old page; the one I was on, disappears. It becomes a blank page with "[object]"displayed in the top left corner, nothing else on the page.

    Is there another way to do this?

    Try wrapping it in a vacuum similar to this:

    JavaScript:void(Window.Open...);

    or to add with

    Returns false;

    as

    JavaScript:Window.Open (...); Returns false;

  • How to display the context menu using javascript in application of apex

    Hi all

    y at - it someone who has set up a context menu using javascript in its request for apex. We may be able to open other pages I need when clicking on items in the context menu.

    Please answer as soon as possible. I will be very grateful to you all.

    Published by: user12259335 on November 23, 2009 01:18

    Hello
    Sorry, you are right, I don't send you all the :), but I have a request - could you just give me your email address to send you the code.
    Tahnks

  • Anyway do a MODAL popup window in the APEX, using JavaScript

    Y at - it anyway to make a MODAL popup window in APEX, using JavaScript.

    What I do is, at various stages in an application, I'm coding, the system will display a pop-up window, prompting users to enter their credentials. These credentials are then verified via LDAP.

    Basically I don't want the user to be able to close the window without entering their password or by clicking on the Cancel button.


    Here is the code I use:

    onClick = "javascript:esign();" "(Adding the HTML Form element attributes)


    function esign() {}
    popUp2 ('f? p = & APP_ID.:8: & SESSION.: & DEBUG.:', 450, 200);
    }



    I did a quick search on google and I met some JavaScript libraries that could do what I'm after is to say prototype.js, jquery.js
    but I was wondering if there is a default library that comes standard with APEX.

    Any help gratefully received

    Thanks, Keith

    create a button calling url and url target as the value
    JavaScript:modalWin();

    Place this script in the header

    You can create a button in a modal window to close
    and use this code for the text label of the button

    Closet

  • Show or hide the buttons of the model using JavaScript

    Can someone tell me to know to disable, show and hide the buttons of the model using JavaScript? In my case, I use AJAX for validation and the validation failed, I want to deprive the person's ability to submit the form. I did successfully using the HTML buttons but they seem ugly and do not correspond to the theme of the application. I really want to do using the model based buttons. Anyone know the answer to that?

    You can find that here:

    http://Apex.Oracle.com/pls/OTN/f?p=31517:143

    The only problem you have to solve is to assign an id to each template button. Rather than use an id string coded hard = "buttonHide1" as in my example, you could use id = "" #LABEL # "If there are a lot of different buttons you need to display / hide on a single page." However, at the same time make sure that the processes are also conditional and follow the logic. To hide a button, this isn't a guarantee that a process can not be executed.

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Opal-consulting.de/training
    http://Apex.Oracle.com/pls/OTN/f?p=31517:1
    -------------------------------------------------------------------

  • How to validate the field "Reason for change" in the commercial indications using JavaScript?

    How to validate the field "reason for change" in the commercial directions Summary tab using JavaScript?

    Current version of PLM4P: v6.1.1.5.2

    Please help me to validate the fields using JavaScript.

    Thank you

    Nefertari

    Developed using some of the Javascript predefined functions that we offer, it's just JavaScript and jQuery.

    But here is an example.

    (Use Internet Explorer F12 developer tools to find the IDS of the fields to work with.)

    $(document).ready(function() { 
    
        if (UI_Ext_isSpecInEditMode && UI_Ext_HasWorkflowBehavior('1005'))
        {
           //normally, we can use jquery to retrieve elements ($('#ifOfInput).val()), but it seems to fail when the id and the name attributes are the same. so we just use javascript document.getElementById instead.
           var reasonForChange = document.getElementById('ctl01$SpecSummaryctl1$ctlCollapsibleContentContainer$ctl00$txtChangeReason')
    
           if (reasonForChange != null) { 
    
                if (reasonForChange.value == null || reasonForChange.value.length == 0) {
                     UI_Ext_MarkFieldAsRequired('ctl01_SpecSummaryctl1_ctlCollapsibleContentContainer_ctl00_lblSpecSummaryReasonforChange');
                     alert('Reason For Change is required');
                }
           }
        }
    }); 
    

    However, not the user registration or workflow specification. If you were to do this, you must remove record them and workflow buttons and links, and this probably isn't the best practice. On the contrary, you would write validation server that would give you this error message if they try to save/workflow. (So most customers do not use Extensions of the user interface for this type of validation).

    Kind regards

    Ron

  • Pop - up using javascript in dynamics of the Actions

    Hi all

    Before you begin with the question, I want to share the below of the details on the application

    Table creation script

    create table status_dashboard (ID number, name varchar2 (10), varchar2 (10) State, varchar2 (1000)) URL;

    Insert the script

    insert into status_dashboard values 1, 'A1', 'up', 'www.ibm.com';

    insert into status_dashboard values 1, 'B1', 'up', 'www.hp.com';

    "insert into status_dashboard values 1, 'C1', 'up', ' www.msn.com";

    insert into status_dashboard values (1, "D1", "low", "www.yahoo.com'");

    insert into status_dashboard values 1, 'E1', 'up', 'www.oracle.com';

    insert into status_dashboard values 1, 'F1', 'up', 'www.facebook.com';

    insert into status_dashboard values (1, 'G1', 'down', 'www.twitter.com');

    "insert into status_dashboard values 1, 'H1', 'up', ' www.google.com ';

    insert into status_dashboard values 1, 'I1', 'up', 'www.apex.oracle.com';

    Report query

    SELECT max (case when mod (rn, 3) = 1 then end name) col1

    , max (case when mod (rn, 3) = 2 then end name) col2

    , max (case when mod (rn, 3) = 0 then end name) col3

    , max (case when mod (rn, 3) = 1 then decode (status, 'down', 'red', 'green') end) The_color1

    , max (case when mod (rn, 3) = 2 decode (status, 'down', 'red', 'green') then end) The_color2

    , max (case when mod (rn, 3) = 0 then decode (status, 'down', 'red', 'green') end) The_color3

    , ceil ((rn) / 3)

    (select name, status, row_number() on rn (order by name) of status_dashboard)

    Group by ceil ((rn) / 3)

    order by ceil ((rn) / 3)

    Report link on Oracle Apex

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

    I created a matrix report, enabled the conditional formatting. The only problem I have right now is to go to a link in the report.

    I use 3 text elements Apex - P1_ID, P1_NAME and P1_URL.

    I use also 3 dynamic actions

    1. DEFINE NAME - will set the P1_NAME field with the value clicked in the report.

    2 SET ID & URL - define the fields P1_ID and P1_URL of the DB using the P1_NAME field.

    3-pop-up-appears the P1_URL using javascript.

    Problem statement:

    The pop up page is a blank page, although I can see that the value for the P1_URL field is defined using dynamic measurements.

    Could someone please take a look at this example and help me with the same.

    PS: The example was developed using sample data.

    Hello

    When you use the substitution in JavaScript string, the value is used when page and is pretty hard-coded in the document value.

    Even if you change the value of the element or the element value in session state, it will not happen to the HTML document.

    In dynamic action, try something like

    popupURL($v("P1_URL"))
    

    Who will choose the value of the item and pass it to the popupURL function.

    Yes, you have created, sample, but how we can view source if we are unable to connect your workspace?

    Kind regards

    Jari

  • Setting value using javascript on the form of tables created by APEX_ITEM

    I can assign the value using javascript on normal form of table as below:

    var vRow = pThis.id.substr (pThis.id.indexOf ('_') + 1);
    $x_Value ('f05_' + vRow, 'Value');

    However I can't do the same if the tabular presentation is dynamically created by APEX_ITEM.

    Some tips on how to do this?

    Thank you

    If this should not be something like:

    this.id.substring(4, 8)
    

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Apress.com/9781430235125
    http://Apex.Oracle.com/pls/Apex/f?p=31517:1
    http://www.Amazon.de/Oracle-Apex-XE-Praxis/DP/3826655494
    -------------------------------------------------------------------

  • How to use JavaScript to limit the number of boxes to check the user can select a PDF form?

    How to use JavaScript to limit the number of boxes to check the user can select a PDF form?

    Here's the working solution

    Please rename all the boxes like chkBox0, chkBox1... .chkBox30 (must start with 0)

    Value of exports of each checkbox must be "Yes" (default value is Yes)

    Place this Code at the level of the Javascript Document

    -Code JavaScript document-

    var counter = 0;                Checked the meter

    -Count boxes checked again when the document is closed and reopened.

    for (var i = 0; i)<= 30;="">

    If (getField("chkBox"_+_i).value == 'Yes') {}

    Counter += 1;

    }

    }

    -The function of validation-

    function validateCheckBox(name,value) {}

    If (value == 'Yes' & meter)<>

    Counter += 1;

    } else if (value == 'Off') {}

    counter = 1;

    } else {}

    getField ("name") .value = "Off";

    App.Alert ("you can select only four checkboxes");

    }

    }

    -End of Document Javascript-

    Now put this line in the MouseUp event all checkboxes

    Box - Code MouseUp event.

    validateCheckBox (event.target.name, event.target.value);

    //----------------------------------------------------------------------------------

    Hope this will help

    Kind regards

    Post edited by: Mohammad Irfan

  • disable a button using javascript

    Hi guys,.

    How to disable a button using javascript code?

    I used below the code, but its does not work any idea with this...
    document.getElementById('DELETE_BT').disabled = true; 
    My button key attributes is id = "DELETE_BT" .


    Thank you in advance

    Hello

    Try this:
    Use it in your JavaScript code.

    $('button[type="button"][value="Cancel"]').attr('disabled', 'disabled');
    

    It's a jQuery code I've tried on a button of the model with label/Alt text like "Cancel".
    which is used in above code * [value = "Cancel"] *.
    The normal deactivation mechanism with above methods do not work on the model function button
    as it is not built usinginternally in the ApEx, but using
    and that's why they don't have any idattribute.

    I hope this helps!
    Kind regards
    Kiran

  • Add level application and document events using javascript

    Hi all

    I need to do a validation in the case of the preliminary version of the pdf document. There are samples available using the interface user and adding the script in the script dialog box, but my requirement is that I need the card of the "preprint" event and the event handler for the document pdf using javascript code pure without the user interface. Any help would be greatly helpful. Thanks in advance.

    Kind regards

    Cherkaoui

    WillPrint is raised when the document print - after pressing the button print in the dialog box.

  • Using Javascript in Acrobat to emulate the Image LiveCycle field

    Hi all

    I have a pdf form complex with many validation & calculation javascript calls that really could use the functionality of LiveCycle image field: i.e. having a user with reader to insert their own image in a form to fill out.  Images have no need to be submitted or snippet somehow.

    Does perform a work around this feature in Acrobat 9 Pro (which I have) or X (which I might be able to get) with JS that could create or approximate the image field feature?  Given the complexity and the volume of calls JS, I don't see whether a conversion of form in LC value and recreate isn't an option at this point.  Any advice would be welcome.  Thank you in advance.

    Unfortunately no, which is a restriction unnecessary and stupid. Please submit a feature request for it in the hope that it will get restored someday. Feel free to add to it: http://forums.adobe.com/thread/743823?tstart=0

    This question was raised yesterday here: http://forums.adobe.com/thread/844010?tstart=0

    and here: http://forums.adobe.com/thread/844480?tstart=0

    However I am not at all convinced that Leonard R. is right. Even if it is, it would make them out of reach of most.

  • Using Javascript - is this the best way

    Hi all
    I'm not very saavy Javascript please bear with me. I searched the forum and have not been able to find an answer (but maybe it's because I could not properly ask)

    I think I need to use Javascript to get the Entry1Date to change if the text in entry1 of changes on the ground. Then initailly, the field is empty so there no populated date. But after that the user enters data for example "call Bob" when they tab out or the entry1 loses focus, I want entry1date to be pouplated with and then the sysdate is they go back and change to 'Call Fred' the entry1date will change again. There are several fields like that so I don't want the user to have to submit the page each time, but when they do not, it will save to the database with the date and the most recent data... Several people will update some of the form fields that I think might be a problem of savings and I would appreciate suggestions as to relieve as well... Thanks for your patience with a Javascript newb. example of the type of fields is below:

    created_by
    Date_created
    Team1_contacts
    Team2_contacts
    Team3_contacts
    Entry1
    Entry1Date
    Entry2
    Entry2Date
    Input3
    Entry3Date

    Wally

    You're in luck then! ApEx 4 introduced dynamic actions, which should you get just to be without having to return to Ajax & application process. You can define a dynamic Action that will trigger a change in a component-based and allow you to set the value of another article, and you can specify that the value comes from the database, as a

    select sysdate from dual;
    

    This tutorial should provide information to help you get started: http://st-curriculum.oracle.com/obe/db/apex/r40/apexdynactions/apexdynactions_ll.htm

    Look specifically at "Creating a Set value Action with a dynamic SQL statement" - location appears a Department when changes in point of service, but you'll get the idea.

    Hope this helps,
    John

    If you find this information useful, please do not forget to mark the 'useful' or 'correct' post so that others benefit as well.

Maybe you are looking for

  • problems with calendar

    I'm having a frustrating problem with calendar projects. When the project is exported to another preview of pdf or simply buy, the months at the bottom of the page text appears as very low. There is no way to change the font size at all stages of the

  • HP Photosmart Plus B209A does not print black ink despite trying two separate NEW ink cartridges black

    HP Photosmart B209A more MAC No error messages but trying to align or check colors - black doesn't print at all No change - knew ink was low so I tried to install a new black ink cartridge - then one day later tried an another new black ink cartridge

  • HP Envy 15 t-j100: Beats Audio does not work after the new update of Windows 10?

    My laptop set to automatically update itself with the new update of windows 10, and after checking my laptop I discovered that the bat sign was gone and uninstalled in my pc. The sound from my laptop has no depth and clarity. Is there a way I could f

  • Z500 brightness problems Windows 8.1 nvidia GT740M

    Hello. I have problems with brightness adjustment on my z500. I tried to download and install the "intel" driver update, but get the message that I'm already running later. And I can't find any earlier version in my drivers on drive D. I was using ju

  • Challenges

    Hola hace unos dias ends el LV core 1 course y quisiera saber if exist alguna pagina o algun libro donde vengan problemas para poderlos resolver in LV, lo busco're formar algo experiencia in este Programación entorno. Tengo los exercise example pero