Conditional Javascript
I use Apex 3.2, stock if not dynamic
I have 2 items on page
P10_BMI_LONGDESCR
P10_BMI_SHORTDESCR
Once I filled in P10_BMI_LONGDESCR, I want the copied value to P10_BMI_SHORTDESCR and vice versa.
I have this work to help
< script >
function setshortdescription() {}
x = $v ("P10_BMI_LONGDESCR");
$s ("P10_BMI_SHORTDESCR", x);
}
< /script >
< script >
function setlongdescription() {}
x = $v ("P10_BMI_SHORTDESCR");
$s ("P10_BMI_LONGDESCR", x);
}
< /script >
Now I want only this javascript to run to new records (Insert Mode).
I have an element of the P10_BMIID page, which contains only the value, if the record exists (Mode of update)
I tried to use
y = $v ("P10_BMIID");
If (there == null)
and also
If $v ("P10_BMIID") == "
How can I make this javascript works only when P10_BMIID is set
See you soon
Gus
Hello
Then try
if(!$v("P10_BMIID")){ /* code here. it will be run if item P10_BMIID do not have value or not exists on page */ }
Kind regards
Jari
Tags: Database
Similar Questions
-
Dynamic Action condition javascript checkbox.checked count >; 0
Hi all
I'm stuck with a condition of the dynamic action. I have the following:
$("#P302_COMPANY").val () .length > 0 & & ($("#P302_DEPARTMENT").val () .length > 0 | $("#P302_PRODUCT").val () .length > 0 | $("#__P302_INDUSTRY__").val () .length > 0)
What would be nice if all items were areas of text, but P302_PRODUCT and P302_INDUSTRY are the lists box, and I want to check if 1 or more values in the list are checked... but I can not work how to do it... any ideas?
Thank you
TSD
Hi Tod
then three is still fair to say if the element has a checked value?
Yes, but not straight forward. You need a javascript routine that traverses the dom looking for items of type box to the appropriate div, and then, for each item in the loop, set a flag if the checkbox is set (assuming that you only 1 of the total updated check).
Another way would be to create a hidden page element, say P302_PRODUCT_CHECKED, then put a dynamic action on the element of the page P302_PRODUCT with the onclick event and a condition that if the box return value is not null, then the real event will mark the beginning session state (PL/SQL Expression - apex_util.set_session_state) and the value for P302_PRODUCT_CHECKED to say 'Y '. You would need a false event to set P302_PRODUCT_CHECKED to null if the checkbox is not set. You can then test #P302_PRODUCT_CHECKED == 'Y '.
Concerning
Paul
-
Dynamic action on what condition (Javascript)
Hello
How can I check if trigger element text color is black for help when condition (expression javascript)?
Trigger itself is .apexir_WORKSHEET_DATA tr (Journal of interactive report data line)Hi Rennokas,
Try this:
$(this.triggeringElement).css("background-color") == 'rgb (0, 0, 0).
'rgb (0, 0, 0)' is the black color RGB code.
-
Reference to a Page element in the expression of the dynamics of the Javascript Actions
I hope it is easy enough for the experts here!
I have a dynamic as action below
Event - lose Focus
Selection type - jQuery Selector
jQuery Selector - entry: text
Condition - Javascript expresion
value - this.triggeringElement.value > 37.5
instead of the 37.5 I would like to make reference to: P16_HOURS
What is the syntax to refer to this element of the page, I tried as above and P16_HOURS v ('P16_HOURS'), $v('P16_HOURS').value
nothing works (as you can see javascript is not my forte!)
Thanks in advance
ChrisHello
Did you try
$v('P16_HOURS')
http://docs.Oracle.com/CD/E37097_01/doc/doc.42/e35127/javascript_api.htm#autoId34
Kind regards
Jari
-----
My Blog: http://dbswh.webhop.net/htmldb/f?p=BLOG:HOME:0
Twitter: http://www.twitter.com/jariolai -
Appeal process in Javascript page
Hey guys! Just shortly after work on my conditional Javascript dialog function, I came across another small problem which is as follows:
I need to call a process page of the "dialogwarning" Javascript function when the backup is click on the button of a dialog jquery.
The update action work already but the pl/sql process is not carried out.
In fact, it cannot be so difficult...
Can you please give me a hint how to do it? So far I've only seen son were JavaScript was called in a pl/sql procedure - not vice versa.
Here is my code for the dialog box:
Any help is appreciated!$(function(){ $("#dialogwarning").dialog({ autoOpen: false, bgiframe: true, modal: true, width: 400, minWidth: 400, resizable: true, buttons:{ Save: function(){ doSubmit('UPDATE','APPLICATION_PROCESS=proc_reset_mx_results'); }, Exit: function(){ $(this).dialog('close'); } } }); }); </script>
Kind regards
SebastianIf the update action works, it is possible that your application process, without that it runs values in the settings.
Try to put the process on the page, with the condition back when you press the update button.
-
Dear,
I used universal theme and I am trying to use the button down dynamic Action can add line tabulated by press enter user, I use this steps but now works
1. in the Add URL redirection button action and cela javascript:apex.widget.tabular.addRow() of the target.
2 create events: dynamic action down key
Selection type: Javascript Expression whose value of the window
Condition: Javascript with window.event.keyCode condition Expression is 13;
Action: Run the JavaScript Code
Code:AddRow();
Also I use real Action: adjust the focus
Type: jQuery selection
jQuery Selector: [name = f03]: last
Note: these steps in the old theme 26
Please give me the solution
Kind regards
Ahmed
Hello
I forgot to Yes to include javascript Legacy
This a demo application
https://Apex.Oracle.com/pls/Apex/f?p=33471:1
You can press the Enter key to add a new line
-
Dynamic action - control multiple non-null
Hello
I have a requirement that only if the two elements (P3_ITEM1 and P3_ITEM2) are not null, then the button should display.
When I create a dynamic as action below
Event = > release button
Items = > P3_ITEM1, P3_ITEM2
State = > is not null
Show the button with a false action as well. The sample is here https://apex.oracle.com/pls/apex/f?p=62495:3:
But in this case, the condition does not work as I want. If one element is not null indicates the button. If I give Expression Javascript as a condition with $V ("P3_ITEM1")! = null & & $V ("P3_ITEM2")! = null is also not working.
Can someone help me with this.
Thank you.
Hi Benjamin-Oracle,
Jeremiah-Oracle wrote:
I have a requirement that only if the two elements (P3_ITEM1 and P3_ITEM2) are not null, then the button should display.
When I create a dynamic as action below
Event-online unlock key
Elements-online P3_ITEM1, P3_ITEM2
Condition => is not null
Show the button with a false action as well. The sample is here https://apex.oracle.com/pls/apex/f?p=62495:3:
But in this case, the condition does not work as I want. If one element is not null indicates the button. If I give Expression Javascript as a condition with $V ("P3_ITEM1")! = null & $V ("P3_ITEM2")! = null also does not work.
Try with Condition = Javascript and JavaScript Expression Expression as:
($("#P3_ITEM1").val().length > 0 && $("#P3_ITEM2").val().length > 0)
Kind regards
Kiran
-
Apex 4.2
Theme 21
I have a report and one of the columns contains the html button.
This button calls a javascript
function obj (start_date, end_date) {}
$x('P840_START_DATE').value = start_date;
$x('P840_END_DATE').value = end_date;
Apex. Submit({Request:Request,showWait:true});)
}
This defines certain elements of page and the request and submits the page.
I have a second report that appears only when the request is resolved.
This report is displayed as the first report.
Is there a way to pass the second report, when the send is completed.
I tried
function obj (start_date, end_date) {}
$x('P840_START_DATE').value = start_date;
$x('P840_END_DATE').value = end_date;
Apex. Submit({Request:Request,showWait:true});)
window.scrollTo(0,document.body.scrollHeight);
}
It moves to the bottom of the page, while the page shows.
Once the pages are reloaded, it's the top of the page
Gus
Hello Gus,
The above mentioned problem is resolved. Please check the same.
Of more apologies for suggesting the following solution:
$.scrollTo($('#USERTABS'), 1000);
The solution is:
$(window).scrollTop($("#order_items").offset().top);
I added a dynamic action on the loading of the page running mentioned above conditional javascript for the application that you use in apex.submit i.e. show_obj
NOTE: The button "Go to order Items" and javascript function nav() is just added for testing purposes.
I hope this helps!
Kind regards
Kiran
-
How to hide/show a field based on the data from more than 1 field?
Hello.
I'm trying to hide/show a based on the data of field2 and field3, Field1
in fact using dynamic measurements I can only hide/show Field1 Field2-based, but I need a combination, for example:
If field1 = 'A' and field2 = 'B', then see the field3, other hide field3
y at - it an easy way to do it.
I use Application Express 4.2.4.00.08
Thanks in advance
Dynamic action
On the changes
jQuery selector: #P1_ITEM_1, #P1_ITEM_2
Condition: JavaScript
$v ('P1_ITEM_1') == 'A' & $v ('P1_ITEM_2') == 'B '.
Real Action: show item 3
Action of false: hide item 3
-
APEX dynamic action - how to hide an element after the loading of the page
Hello
I have a form with the element Type, lesson and page. I want to create a dynamic as action ' on page load "If Type = x don't then see the lesson and the elements of the page. .
How can I know if Type = x don't see the lesson and the page. It does not show them.
Please note the dynamic, action = Page load event
Thank you
Try adding
When the Condition "Javascript expression."
Value: $v ('P1_TYPE') == 'x')
-
Run DA plsql code table updated using the click of checkbox
Hello
I have a box with action Dynamics plsql code to update a table when event = click/change, but only when the box is turned "on" everything seems to be ok, but the code plsql for updating the table does not work because the record in the table is not updated. Any help on this pls?Tell us is there a LOV for item checkbox?
Try sth like this:
Lets assume the id box is P1_CHECK.
Interior check point to put the list of values like this:STATIC:CheckMe;1
Then, when you create a dynamic action, put smth like this:
Event: Clicked Selection Type: Item Item: P1_CHECK Condition: equal to Value: 1
or
Event: Clicked Selection Type: Item Item: P1_CHECK Condition: JavaScript expression Value: $x('P1_CHECK_0').checked
Hope this helps you, Mimi
Published by: Mimi on October 28, 2012 21:06
Published by: Mimi on October 28, 2012 21:09
-
Draw attention to the Cancel button
Hello
My requirement is... when the user press the button CANCEL on the form, check the State of P12_STATUS. If the status is 'NO' then show an alert. If it is false then redirect to page 125.
To do this, I defined the button CANCEL 'Action' to "Defined by the dynamic Action" and created the DA as below
Event: click ON
Selection type: BUTTON
Button: CANCEL
Condition: Javascript
Value: $v ('P12_STATUS') == 'NO '.
True: Alert == > works very well
False: Wanted redirecting to page 125.
I don't know how to redirect to a page in my FALSE action.
Please help me. If this is not the right approach, please let me know the right way.
Thank you
Leo.Hi Leo,
In your dynamic Action add false Actions as below
Action -> Execute JavaScript Code Code: if($v('P12_STATUS')=='Y') { window.location="f?p=&APP_ID.:125:&SESSION.:::"; }
or use the below javascript in the HTML page header
Button cancel change redirect to URL action
javascript:Redirect();
Brgds,
MaxPublished by: Max on 18 August 2012 10:10
-
Page zero Java Script of Validation does not
Hi friends,
I use page zero and that's to have and to the point of dates (: p0_from,: po_to).
now I use dynamic action to validate (: p0_from,: p0_to) using java script, it works very well with chrome and Internet Explorer, Mozilla, it does not work.
Dynamic action > event: cick > button > condition: javascript > Date.parse (document.getElementById("P0_FROM").value) > Date.parse (document.getElementById("P0_TO").value) > True: alert > false: send page
Please help me on this...
concerning
ChauvetHello
There are problems with date formats supported by the browsers, so I tend to avoid the JavaScript Date object as much as I can.
In your case, as with most of the Oracle users, DD-MON-YYYY format is not supported in most browsers. If you convert your date on the item page format to yyyy-mm-dd or yyyy/mm/dd him DA would work. But then users may not be comfortable with this format, especially if they are used as MON-DD-YYYY / RR.I changed you request in one of the following ways, it now works in IE and FF. Not tested with chrome, but should work with it.
BTW, I changed the status on your DA 'Never' to prevent it from running.Step 1: Add an element of Hidden P0_DAYS
Step 2: Add a DA on the submit button
Event: Click on submit
Action: Execute the PL/SQL Code
Code::P0_DAYS := TO_DATE(:P0_FROM,'DD-MON-YYYY') - TO_DATE(:P0_TO,'DD-MON-YYYY');
Present: P0_DAYS, P0_FROM, P0_TO
Return items: P0_DAYSStep 3: Adding DA on P0_DAYS
Event: change
Condition: Top: 0
Added appropriate action True and False alerts.See you soon,.
-
I have two dynamic actions for an item from the selection list that is loaded from an element of Cascade LOV.
Dynamic action 1:
Name: d1
Condition: Value = "EXPECTED".
true action: see the 'Solution' element.
action of false: hide a 'Solution '.
Dynamic action 2:
Name: d2
Condition: Value = 'OFFERED '.
true action: see the 'Solution' element.
action of false: hide a 'Solution '.
That's happened? If only works with the dynamic action of d1 or when I did some changing works with dynamic action of d2. I unchecked the field "load fire on the page" but it did not work. I think that there is perhaps some collide with them but I analyzed it, but I can't find. Thanks in advance.
Another thinks I want to ask is how to order values in a select list... with this code above indicate me the values in the following order: closed, lift, open, waiting. But I want the values in the following order: open, pending, climbing, closed. How can I do?
Best regards, Bernardo.select distinct STATUS as display_value, STATUS as return_value from HD_STATUS order by 1
Ah so. It's actually easier then.
You'll have an installation DA your d1 is configured with the following differences:
Name: d1 Event: Change Selectio type: Item(s) Item: P10_SUBSTATUS Condition: Javascript expression Value: $v('P10_SUBSTATUS')==='PLANNED' || $v('P10_SUBSTATUS')==='OFFERED' true action: Show "Solution" item, false action: Hide "Solution" item. Nothing in the Condition box that currently has the PL/SQL expression. (Make sure to select "None" as the condition type in the condition box)
You need basically the GOLD option that is provided above as Javascript. ' | ' is the operator or if you are not familiar with JS. ' = ' means exactly equal to, and possibly "==", equal to so you could also put it this way.
Should have thought first of this route.
Published by: Bob37 on June 28, 2012 16:15
-
With the help of JavaScript condition in the dynamic action of JQuery selector
Hi guys,.
I have a Setup master detail on a page.
The detail section, I have a tabular presentation. One of the fields is a selection list. The first record in the select contains the value * not * that has a value of primary key for the 1. I have a distinct region with a simple text field where the user can insert a value into the table if the value does not exist.
I want than the region of text element to only appear if the value * not listed * is selected.
I managed to make it work when the value is selected with the help of dynamic action with a bit of JQuery and JavaScript by setting the ID on the selection list to 'create' and have the following in JavaScript $(this.triggeringElement) .val ()! = 1 in the JavaScript for dynamic action condition shows it or hides the region of 'create' and that works well.
However, if the secondary table is empty before the detail records were created (nothing selected in triggering jQuery Selector) the region of create is displayed when I don't want it.
I guess I need some sort of NVL in JavaScript condition?
I use APEX v4.2.
Any advice would be appreciated.
Chris
Cashy wrote:
I have a Setup master detail on a page.
The detail section, I have a tabular presentation. One of the fields is a selection list. The first record in the select contains the value * not * that has a value of primary key for the 1. I have a distinct region with a simple text field where the user can insert a value into the table if the value does not exist.
I want than the region of text element to only appear if the value * not listed * is selected.
I managed to make it work when the value is selected with the help of dynamic action with a bit of JQuery and JavaScript by setting the ID on the selection list to 'create' and have the following in JavaScript $(this.triggeringElement) .val ()! = 1 in the JavaScript for dynamic action condition shows it or hides the region of 'create' and that works well.
However, if the secondary table is empty before the detail records were created (nothing selected in triggering jQuery Selector) the region of create is displayed when I don't want it.
I guess I need some sort of NVL in JavaScript condition?
I use APEX v4.2.
Simple solution is to hide the region containing the element of text by default, using the style = "" view: no ' in the property of the attributes of the area in the region. " It will be always hidden when the page initially, but its visibility will be controlled by the DA subsequently.
Maybe you are looking for
-
Please sign the french petition to keek Skype on SMART TV
HERE Thank you very much
-
Satellite A100-200 - screen dead/black
A100-200 laptop bought in November 2006 and have not used it since. Last year, the screen is lit and failed frequently until it now shines at all. The fans are working and heat production. Some people say the motherboard was going on, but this seems
-
iTunes syncs not apple iPod nano's music
I joined Apple music. I want to put the songs I buy my new 7 generation iPod Nano. He said: you cannot synchronize music on iPod, Apple I f you want to listen to the song on your iPod turns on iCloud on your iPod. I have a nano. I don't see an option
-
Satellite A300D-1EI - error blue screen display - drivers did not have
I bought my laptop about a month ago.Everything is working great except two errors 'blue screen' caused by the graphics card. Both were when the laptop was connected to the TV via the S-video port.First was when the computer screen turns off after 15
-
Please help me!, new user
Hello, I hope someone can help me, I don't see any icons on the browser, wi - fi, not the lock or something, no EDGE NOTHING!, just the blue arrows. I used to see them but they're just gone, can someone help me please?, im a new user of BB (my phone