JavaScript function: passing values
Hi allI'm trying to call a javascript function in apex oralce to pass two variables.
onfocus = "calTotalPrice (QUANTITY, and UNITPRICE)";
I am calculating the price total based on the 'quantity' and 'Unit price'... but values do not happen.
Please suggest me the correct syntax for passing values into a function.
Kind regards
Sandeep Reddy
Here is a function I use to take three input fields and fill a fourth:
function calcBMI(formItem1, formItem2, formItem3, formItem4) {
var bmift = document.getElementById(formItem1).value;
var bmiin = document.getElementById(formItem2).value;
var bmiht = bmift*12 + parseInt(bmiin);
var bmiwt = document.getElementById(formItem3).value*703;
var bmi = Math.round(bmiwt/(bmiht*bmiht)*100)/100;
document.getElementById(formItem4).value = bmi;
}
Tags: Database
Similar Questions
-
JavaScript: to pass values to another page
Hi all
I HAV an interactive report. If I clik on a particular line, who has the rank of values must be sent to another page (via javascript)
I found this forum https://forums.oracle.com/thread/2467579 in which they hav used to send mail.
but I wanted to pass those values to another page throug javascript bz, I HAV installed a nd wrking her under right clik plugin.
my javascript function is,
function func (action, el, pos)
{
Window.Location ="http://apex.oracle.com/pls/apex/f?p=71510:2: & SESSION.: 2:P2_X, P2_X2:'+ $(el).children('td[headers="EMPNO"]').text () + ',' + $(el).children('td[headers="ENAME"]').text ()";
}
Here I HAV it redirected to page 2 and on the 2nd page I HAV 2 elements used to get these values.
$(el).children('td[headers="EMPNO"]').text () + -> is to fetch the empno of that particular line and the same for the name.
But if I click on the right button clik, no action that happens...
but his work well, if I use the function as,
function func (action, el, pos)
{
Window.Location ="http://apex.oracle.com/pls/apex/f?p=71510:2: & SESSION. » ;
}
so somewhere will not passing the values in the URL, I guess...
and I HAV used al d above things in
http://Apex.Oracle.com/pls/Apex/f?p=71510:1 (username: test / paswrd: pex14gm)
pls help me...
Thanks in advance
Try like this.
function func (action, el, pos) {}
var empNum = $(el).children('td[headers="EMPNO"]').text ();
eName var = $(el).children('td[headers="ENAME"]').text ();
Window.Location = "http://apex.oracle.com/pls/apex/f?p=71510:2: & SESSION.: 2:P2_X, P2_X2:" + empNum + ','+ eName; "
}
It looks simple and neat.
If you still get no view me details of the workspace.
-
How to pass the value of the item Application Javascript function.
Hello
I have the JavaScript in the properties attribute of the HTML Form element
I'm on page 1 and passing the value of the item page P1_DEPT_NO. It is perferctly working very well and I am able to get the exact value of the element on the page
I'm on page 1 and passing the value G_DEPT_NO of the Application element .onchange="javascript:function1($x('P1_DEPT_NO').value);"
The problem here is, I don't get the point of Application inside the javascript function value.
I tried to use alert(); and it gives me the undefined value
I just want to know, How to pass the value of the Application in Javascript element.onchange="javascript:function1($x('G_DEPT_NO').value);"
Thank you
DeepakDeepak,
I'm not a Javascript expert, but the suggestin I did was because the javascript is a case-sensitive... language and thats why onChange is not the same thing as onchange.
Not sure if this is causing the problem.Application elements not associated with a page and have therefore no properties user interface.
So, as mentioned in another post, the rendering would not work for the elements of the application.
If it is for a single item, used only on this page, you might create a hidden page element and use it fo your goalIf you want to keep watching objects application and AJAX, this page contains examples of using AJAX to solve problems like the one you mentioned.
http://www.Oracle.com/technology/OBE/hol08/apexweb20/ajax_otn.htm#T1BThank you
Rajesh. -
Passing a checkbox as a parameter to a javascript function
Hi all
I am trying to add features to my report, I hope you can help me. I have in the SQL report, among other things, a box and a selection list.
What I want to do, is that when the user changes the value of the selection list, it automatically changes the value of the Checked checkbox. I have the SQL like this:
Select
apex_item. CheckBox (1, "SW_CHECKED", Decode("SW_CHECKED",1,'CHECKED',null)) ",
Apex_item.select_list_from_lov status (2, "SW_STATUS", 'F2010051_SET_STATUS', 'onChange = "setCheckBox (this)" ', 'NO').
of Fx1_v
I call a javascript from the sql query function, the call is ok, the problem is that I don't know how to go from the item box to the function, and how it would work. I tried to call the function with the parameter "that", but I think that he is referring to the LOV, not the check box. I also tried with setCheckBox (apex_application.g_f01) but that didn't work either. Any ideas, please?
Thanks in advance!This code I posted, pass the ID of the item box, you can use document.getelementById or the * $x * function provided by their Summit to access and "check".
<script type="text/javascript"> function setCheckBox(cb){ elem = $x(cb); alert(elem.value); $x(cb).checked = true; } </script>
-
Needs of JavaScript function to fire based on the value set by a checkbox
Hi all, I'm doing my best to learn javascript on http://www.w3schools.com and hoped not to have to ask this kind of questions, but until what I fully educated I am a bit stuck.
I run a function on a page of the apex that checks the value of a LOV column in a table, and then did some stuff. This code works fine if it is assumed that the column I'm evaluating is displayed as ' select list - static LOV. If I change the column to display a check box, and then copy the following code no longer works. How should I change this to be able to read the value when the value by a checkbox instead of a LOV?
Also, my function works when a user sets the value after the page is displayed, but I also need it to do such things even on page load. Can I just copy the function in the body of the html page? Perhaps, if someone can just point me in the right direction, I can continue to research. I know there have been discussions on this, but I'm still not entirely clear on how to achieve this.var currIndex = $('select[name="'+pThis.name+'"]').index(pThis); // check current items value (return value of lov) if (pThis.value=='Y')
Thanks in advance everyone to continue to teach me the apex.
JohnHello
You had error on the JavaScript function test
if (pThis.value=='Y' {
There is lack of support.
Plugin UILayout gives also some JavaScript errors, so I State never to that.
Kind regards
Jari
-----
My Blog: http://dbswh.webhop.net/htmldb/f?p=BLOG:HOME:0
Twitter: http://www.twitter.com/jariolai -
Call a javascript function in the Value attribute of param
Hello
I want to put a TLF text field in the SWF file in an HTML page. So I used flashvar, by calling a javascript function to it attribute "value" as follows.
< param name = FlashVars value = "" + SetFlashMovieParam() + "" id = "message" / > "
SetFlashMovieParam() is a javascript like the following function.
function SetFlashMovieParam() {}
document.getElementById("message").setAttribute ("value", "msgText = Start");
}
Even if this does not work, when I put the text value directly to the 'value' attribute, it worked.
< param name = FlashVars value = "msgText = here % 20is % 20The % 20text" id = "message" / > "
I think it's because calling a javascript function syntax error in the param tag. Can anyone help to call this function properly...
Thank you.
Normally when you have an executable code embedded in the html code you should check that article accordingly. In the case of javascript surround you with
-
How to create the javaScript function that erases the text of the field values
Hello
How can I create a javaScript function to clear the values of the text fields
and I want to call this function on the clear button on my custom areaYes it is possible but not recommended approach.
Here is the link that you can use if you want to implement using javascript
http://www.itechies.NET/tutorials/JScript/jsexample.php-PID-set_field.htmThank you
AJ -
Select the list display value from a javascript function
Hi all
I have a list in tabular form, having a display value and return value.
I use $x (statement) .value or $v (statement) for retreving return the value of the selection list in a javascript function.
Can someone let me know how I can get the display of the selection list value in a javascript function? IM using Apex 3.2
Thank you and best regards,
Sandeep
-
Read a value of input to a javascript function ADF area in 11g?
How can you read a value ADF of the input to a javascript function in a jsf (jspx) Jdev 11 g page area?
Thank you.You use the Javascript API for components.
Here's a nice intro:
http://technology.amis.nl/blog/2773/adf-11g-rich-faces-using-clienttriggers-and-javascript-api-to-implement-client-side-logic-in-adf-faces-pages-client-side-programming-in-adf-faces-rich-client-components-part-3 -
JavaScript function to exchange the values of two text entry fields
Hello
I am a beginner APEX with the first application of the APEX. This app has a 22 page to enter data for a graph edge. There are two P22_LINK_NODE_A, P22_LINK_NODE_B text input fields.
Sometimes it is necessary to toggle (swap) the values of these two areas.
To do this, I added a button 'toggle_A_B' HTML and a Javascript function.
But... it does what it is supposed to make :(
By clicking on the button seems to send the page to the server, although this should not be the case... and the values of the fields P22_LINK_NODE_A, P22_LINK_NODE_B do not change.
I didn't expect that everything goes right on the client side.
Is it normal that the browser is trying to send the page?
Do I need to implement something on the side Server? (process, branches,...)
The "toggle_A_B" a button attribute HTML button: onclick = "toggleNodes (); »
Redirect Optioanl of the button is set to "no target". (behavior is the same with "redirecting to page 22")
In the "HTML Header" page, there is the following Javascript function (which works find in a non-Oracle-APEX HTML page).
< script type = "text/javascript" language = "JavaScript" >
function toggleNodes() {}
var x = document.getElementById("P22_LINK_NODE_A").value;
var y = document.getElementById("P22_LINK_NODE_B").value;
document.getElementById("P22_LINK_NODE_B").value = x;
document.getElementById("P22_LINK_NODE_A").value = y;
}
< /script >
There is a post on the forum with a similar topic, maybe I should also use this approach to ($s)?
Kind regards
RomanRoman:
Set the target URL of the Html button
JavaScript:toggleNodes();
CITY
-
How ro read the value of a selectOneRadio in a Javascript function?
I have a selectOneRadio, and when I change its value I need this value to something in a javascript function.
I need the value real (ONE, TWO or ALL) to this function, but it seems that I only get the index of the selected radioButton (0,1, or 2)
Here is my Page source:
< af:selectOneRadio id = "typeRadio" label = "Type".
clientComponent = 'true '.
autoSubmit = 'true '.
Binding = "#{bean." TypeRadio}.
value = "#{bean." Type} ".
valueChangeListener = "#{bean.typeChanged}" >
< af:selectItem label = "First choice" value = "ONE" / >
< af:selectItem label = "Second choice" value = "TWO" / >
< af:selectItem label = 'All' value = 'ALL' / >
< af:clientListener method = "setType" type = "valueChange" / >
< / af:selectOneRadio >
Here's my js function;
function setType (evt)
{
typeComp var = evt.getSource () .findComponent ('typeRadio');
If (typeComp! = null) {}
alert ('type =' + typeComp.getValue ());
type = compType.getValue ());
do other measures and calculations
}
}
The warning in bold shows me 0, 1 or 2 and not ONE, TWO or ALL.
Am I missing something?Hello
the selectOneChoice has a property "valuePassThrough". This true value
Frank
-
Problem with the help of the $s javascript function to fill a page element
Hello Oracle APEX community,
I work on a page dashboard of exploration down and have been a problem when I try to fill a Page of text (hidden or not) element using javascript built in function $s.
The feature works very well when the data is a number such as dept_id (even if the field type is varchar type). However, trying to pass what is a text the process fails, unless a value is hardcoded as parameter to the function. So, for example, I have a table with constituents by State counties. I would like to fill out (filter) a table based on when you click a bar for a State without having to submit the page. I use dynamic actions and built in javascript function in the SQL code for the graph to achieve; But even once, it works fine when I use a field varchar as the FIPS code (FIPS for Texas is "48"), but when I try to fill the page element by using the abbreviation of the State "TX" (new varchar), it fails.
Here is an example of code that works:
And here is an example of code that does not work:SELECT 'javascript:$s("P1_DEPTNO",'||d.deptno||')' LINK, d.dname LABEL, sum(e.SAL) sal FROM emp e, dept d where e.deptno = d.deptno group by 'javascript:$s("P1_DEPTNO",'||d.deptno||')', d.dname
However, when I hard code a value the script text works:SELECT 'javascript:$s("P1_DEPTNO",'||d.loc||')' LINK, d.dname LABEL, sum(e.SAL) sal FROM emp e, dept d where e.deptno = d.deptno group by 'javascript:$s("P1_DEPTNO",'||d.loc||')', d.dname
I encounter this problem on several versions of the APEX: (4.0.2.00.07 - local installation) and (4.1.0.00.28 - apex.oracle.com)SELECT 'javascript:$s("P1_DEPTNO","BOSTON")' LINK, d.dname LABEL, sum(e.SAL) sal FROM emp e, dept d where e.deptno = d.deptno group by 'javascript:$s("P1_DEPTNO","BOSTON")', d.dname ORDER BY d.dname
Does anyone know of this problem and how to solve? I have looked for the parameters of the element of the page itself and can not understand.
I rewrote my sql to use the fields of value of my tables instead, but I have a few objects on the page that will really depend on the data of base characters instead.
Thank you
WayneIn your javascript that you generate, surround your value with quotes and it will then should always work with the numbers and strings (your channels are probably interpreted as variable names and that they do not exist when running, so slip out).
Example:
SELECT 'javascript:$s("P1_DEPTNO","'||d.loc||'")' LINK,
Published by: gti_matt on August 16, 2011 09:50
-
Best approach to call a javascript function in a tabular presentation
Hi all
I have a manual tabular presentation. In this form, I have a javascript function that disables hiredate column. The function is called on the deptno column change.
So, if I select the "Research" Department and hire date field is disabled for the selected line.
I need to run this function also executed automatically on page load. So, it checks if all rows with deptno as search and disable hiredate field for these lines.
Please let know us the best approach to achieve this goal, which does not affect the performance that the page has 2000 lines.
function test2 (pThis) {}
var v_item_value = pThis.value;
var v_hiredate_item = $(pThis).closest('tr').find ('td [headers = HIREDATE] input [name = f05]');
var v_hiredate_button = $(pThis).closest('tr').find ('td [headers = HIREDATE] button "");
var currIndex = $('select[name="'+pThis.name+'"]').index (pThis);
var currRow = currIndex + 1;
If (v_item_value == '20') {}
v_hiredate_item.prop ('readOnly', true);
v_hiredate_button.prop ("disabled", true);
document.getElementById("f08_"+[currRow]).disabled = true;
}
else {}
v_hiredate_item.prop ('readOnly', false);
v_hiredate_button.prop ("disabled", false);
document.getElementById("f08_"+[currRow]).disabled = false;
}
}
Thank you
Zkay
Try this:
Suppose that the deptno column name is "f08".
execute a javascript script that triggers the loading of the page
$("[name=f08]').change ();
-
ADF set (true) disclose to showDetailItem using javascript and pass event
Hi all
We strive to integrate oracle ADF and Oracle Forms. We use integration javascript to call/interact with oracle forms
Presentation of the ADF:
Activate us or disable the appropriate showdetailitem based on a link.
To enable forms indicating technicality (with id formssd1) and the javascript event passes to the forms, we use the code below
function refreshReport(evt) { var formsLayout = AdfPage.PAGE.findComponentByAbsoluteLocator("pt1:r1:0:formssd1"); if (formsLayout != null) { if (!formsLayout.getDisclosed()) { formsLayout.setDisclosed(true); } } var reportLink = evt.getSource(); var reportID = reportLink.getProperty('reportID'); alert(document.forms_applet); if (document.forms_applet != null) { document.forms_applet.raiseEvent('refresh', reportID); } else { window.setTimeout(invokeReport(reportID), 20000); } }
Problem/question:
The forms showDetailItem is it disclosed (true), it works fine. The javascript event through to the form and the form refreshes the report
If the forms point showDetail is not disclosed, javascript allows the showdetail. But the document.forms_applet attribute is not set.
ADF: 12.1.3
Forms: 11g R2
Can you please let me know, how to reach the attribute (document.forms_applet)?
I was able to solve the issue myself. I used a combination of clientListener and serverListener. I called the "document.forms_applet.raiseEvent" of managed bean and it solved my problem
-
passing values from one page to bring up the window page apex
Hi all
I created the java script to open a new window to send mail from apex.
< script language = "JavaScript" type = "text/javascript" >
function send_mails (template_id) {}
Window.Open ('https://hrssc-in.oraclecorp.com/pls/apex/f?p=154:15: & SESSION.: 15:P15_VENDOR_CODE, P15_MONTH, P15_YEAR, P15_DISCREPANCY_DETAILS_DL, P15_DISCREPANCY_DETAILS_CS, P15_DISCREPANCY_DETAILS_PF, P15_DISCREPANCY_DETAILS_ESI, P15_TEMPLATE_ID: & P2_VENDOR_NAME., P2_MONTH., P2_YEAR., & P2_DISCREPANCY_DETAILS_DL, & P2_DISCREPANCY_DETAILS_CS. & P2_DISCREPANCY_DETAILS_PF. & P2_DISCREPANCY_DETAILS_ESI.) (,'+ category, null, "height = 500, width = 1200, status = yes, toolbar = no, menubar = no, location = no, scrollbars = yes") ;}
< /script >
I can change the value of page 2 to the page 15 using the code above that if I choose page submitt for items (action when the changed value of the page).
If there is another way to transmit values without submitting the items (in the action of the page tab).
can someone help me solve this problem
Thanks in advance,
Year sHello
the function of $ v that allows you to get the values of the elements cannot be used as part of the parameter to window.open.
Try to concatenate function calls v$ in the parameterWhat does the category in the parameter string?
Kind regards
Erik-jan
Maybe you are looking for
-
No backgrounds, text fields, text, borders areas. All-black text, all the blue links. Any stylesheet or layout on all internet pages of setting shaped. Just randomly. I uninstalled, rebooted, re installed. Nothing solves this problem.
-
Firefox is markedly slow after update Ubuntu to 13.04 b
I used to run Ubuntu 12.10 & Aurora 22 on my computer. Recently I updated my Ubuntu to 13.04 beta and since has passed, every Web site I try to go to (including Google search and so on...) shows "connecting...". "for about 20 seconds before finally s
-
I want to do a clean install of El Capitan. I am currently using Mavs 10.9.5 and my time machine goes back to 2010. I don't want to migrate everything. I want to start cleaning up. I read a few methods, but I'm curious to know if there is some consen
-
While dragging a folder to another location in my photos if fell off the coast of the bottom of the page and has not bounced back to its original position, now I can't find it, I tried to do a search but you can't always find this any help would be g
-
How do I change the icon of the generic printer for a period that best represents my printer. No problem on the other two systems with Win7, but the new machine gives me a way to change. It is for me a custom icon for my HP printer, but a generic for