Set hidden item in Javascript

Hi,
I am having a hidden page item P4_SELECT in my page. I am trying to set this page item with a value in javascript function.
function getTheCurrentRow(triggerItem){  
    alert( triggerItem.slice(6));
   document.getelementbyid(P4_SELECT).value=triggerItem.slice(6);   
// $x(P4_SELECT).value=triggerItem.slice(6);
</script>Eventhough i am getting value in the alert getting javascript error "P4_SELECT Undefined" .
When i checked the "view Source" of the page it is having this line in it
<input type="hidden" name="p_t04" value="" id="P4_SELECT"  />I tried
$x(P4_SELECT).value=triggerItem.slice(6);But getting same result only. Can't we set hidden item values in Javascript.
Regards,
Jyothi

Hi,
If you are on Apex 3.x or higher , try
function getTheCurrentRow(triggerItem){  
alert( triggerItem.slice(6));
$s("P4_SELECT", triggerItem.slice(6));   
/* Alert hidden item value you did set */
alert($v("P4_SELECT"));
</script>Here is link to Apex JavaScript API document where you can find functions $s and $v I did use
http://download.oracle.com/docs/cd/E14373_01/apirefs.32/e13369/javascript_api.htm#CDEEIGFH
Regards,
Jari

Similar Messages

  • Passing sql report query field value to hidden item in javascript

    I have sql report which has in each row one html button. Let us say that query SHOULD look like (two columns, to be easy to get the point):
    select 1 SECURITY_ID
      , '<input type="BUTTON" value="Top10" onClick="javascript:Top10Click ('||SECURITY_ID||');" >' BTN
    FROM DUAL;
    function Top10Click (vValue) {
      html_GetElement('P31_PROCESS_VALUE').value = vValue;
      doSubmit('GO_BACK');
    } <br><br>
    where P31_PROCESS_VALUE is hidden item where i want to store value of row where click happened.
    <br><br>
    In every button i want to pass row value "SECURITY_ID" to Top10Click function for each row differently.
    <br><br>
    Problem is that when I place double qoute then js is not working, else js is ok but "SECURITY_ID" is passed as constant not as live SQL value.
    <br><br>
    Any help...THX!
    <br>
    Demo is on oracle:
    http://htmldb.oracle.com/pls/otn/f?p=26216:1
    Workspace entry:
    WK: FUNKY
    UN: [email protected]
    PW: qwertz

    I have tried to unify the solution, so it looks like:
    select 1 SECURITY_ID
      , '<input type="BUTTON" value="Top10" onClick="javascript:Top10Click ('||'&quot_X;'||SECURITY_ID||'&quot_X;'||');"  >' BTN
    FROM DUAL;change '&quot_X;' (remove "_X" part ... so it can be seen in HTML properly!
    THX Denes for great ideas...

  • Set application item from javascript?

    Hi!
    Is it possible to set an APPLICATION ITEM from javascript? If so can some one please point me to the thread, or a FAQ or an example, etc?
    Thanks!
    Dave Venus

    dvenus1,
    Sure. In the script below I check variables and populate based on what I find...
    <script language="JavaScript" type="text/javascript">
    function Populate_fld()
    var formVehicle = document.getElementById('P9_HIDE_VEHICLE').value;
    var formState = document.getElementById('P9_HIDE_STATE').value;
    var formTag = document.getElementById('P9_HIDE_TAG').value;
    var formName = document.getElementById('P9_HIDE_NAME').value;
    document.getElementById("P9_VEHICLE").value = formVehicle;
    document.getElementById("P9_TAG").value = formTag;
    document.getElementById("P9_STATE").value = formState;
    document.getElementById("P9_VISITOR_NAME").value = formName;
    if (formState = " ")
    document.getElementById("P9_STATE").value = "FL";
    </script>
    Keep Smiling,
    Bob R

  • Setting application items through javascript

    Is there any way to modify application items using javascript? I would work with page items, but I need something that is guaranteed to be in the session state.

    Oh yes, I know that. Well here's the exact problem (I've posted threads on it from a couple different angles previously):
    - I am trying to open a popup with a report region such that I can send a query to the popup some how, without doing a page submission of the parent page.
    - The current method I am using is to send the query by URL, but I'm reaching the limit of URL length, and it's not a particularly secure solution.
    - My latest idea was to pass-by-reference (what this thread is about), but this presented a couple of problems.
    1) I could set a parent page item dynamically by JS, but the only way I know of loading the information automatically in the popup is using onLoad -- but that's too late.
    2) I could use session state, but I risk Region condition: javascript is enabled?, page session items are not set until a page is submitted, and application session items are not accessible by JS.
    I was thinking that maybe there is some way of accessing browser session state with JS, but I guess not....

  • Example of setting page item using javascript

    Does anyone have an example of setting the value of a page item (hidden) using javascript? I have seen the following in the Forum but I am having trouble implementing it. If someone could show an example of a region it is called from, and the javascript (and where it is placed), that would be great.
    I have tried something similar to this without luck so far:
    function setValue(){
    $x('P1_FIELD').value = 'Oracle';
    Thanks!
    John

    Hi VS,
    you should really use a "Set Value" dynamic action for that, that's much more transparent than using the onclick definition in the button attributes.
    Regards
    Patrick
    Member of the APEX development team
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Set multiple items with javascript function in chart link

    Hi Folks
    I am able to use the javascript $s function to set the value of one item from a chart link. I need to pass values to multiple items.
    Is there a way to use javascript function to pass values for multiple items on a page from a chart link
    Appreciate your responses
    Thanks
    Gopal

    Hi Arnau,
    You need to surround your JavaScript code like this (without the spaces before and after script):
    < script language="Javascript">
      window.open("<%=ABAP_VARIABLE%>").focus();
    </script >
    Regards,
    Patrick.

  • Javascript: set value of hidden item

    Hi,
    I have a select list and a hidden item on my page, after select a value, I want to write this value (and a little bit more) to the hidden item.
    So I have done the following...
    applied to page html header:
    <script language="JavaScript" type="text/javascript">
    function setExpress(item_id)
    html_GetElement('P230_HIDDEN').value = 'Test ' + html_GetElement(item_id).value;
    </script>
    and in selection list I set the HTML Form Element Attributes to onChange="setExpress(this.id); .
    But nothing is written to the hidden item. When I make it a text field it works correct.
    Isn't it possible to set a value of hidden item by javascript? Is there another way to do this (without computation)?
    Thanks for help
    chrissy

    Hello chrissy,
    I don't see the connection between the item being Hidden or Text. The item id stays the same, and so the JavaScript reference to it.
    It is possible to assign values to hidden items using JavaScript, just as you did. In the following page - http://htmldb.oracle.com/pls/otn/f?p=22814:8
    -you can see a working example of your situation – select list populate a hidden item, then display by using alert.
    After selecting from the list you should TAB out, so it will fire the JavaScript event. In your example, you were using onChange. I think that could be problematic in cases were the default value (first value) of the select list is the one chosen – no change there. In my example, I'm using onBlur.
    You can see the JavaScript on the source page.
    Hope this help,
    Arie.

  • Get item value of hidden item in java script on standard report

    I've a report with following query:
    select "ROWID",
    "GTEMPDETAILID",
    "GTEMPID",
    "NORMTEXT",
    "ITEMTYP",
    "ITEM",
    "BEMERKUNG"
    from "#OWNER#"."ALAVIS_GTEMPDETAILS"
    Item GTEMPDETAILID is hidden (set in column attributes).
    I defined an onclick event in the report template to set the value of GTEMPDETAILID into a Page item. This works, if the GTEMPDETAILID is not hidden. But how can I get the value of an hidden item in javascript?

    I am guessing this hidden value is not a protected item because youre manipulating the value. How about setting is a textfield but inside the "HTML form element" property, specify style="display:none;" or you can nest <script type="text/javascript">$x_Hide("ID_OF_TEXTFIELD");</script> in the page somewhere...
    Question, have you tried using $x_Value('ID_OF_ITEM','VALUE_OF_ITEM') ? this is APEX javascript API
    you can also use $x('ID_OF_ITEM') to retrieve DOM object, or $v('ID_OF_ITEM); to retrieve item values.
    Let me know if you need additional assistance.
    Edited by: srbonham1 on Jul 27, 2012 4:31 PM

  • Set value of a display only item using javascript

    I was trying to find an answer in the forum but my searches gave me no results. How do
    I set a value of a display only item using javascript (ajax)?
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

    Vikas,
    Thanks for a fast responding. The type is Saves State. However, I tried to set the value
    of a display only item using:
    <script>
      function f_setDisplayOnly ()
        {$x('P80_X').parentNode.childNodes[4].nodeValue = 1;
    </script>without a result (or error). What am I doing wrong?
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • How to set date value in hidden item

    I have a form which has an date item, P1_MTIME , if I use data picker and an procedure (After header)to define its default , as
    begin
    :P1_MTIME := to_char(sysdate,'DD-MON-RR HH24:MI');
    end;
    Everything works fine, but when I change P1_MTIME to hidden, I can only get its value set to date, not hour and minutes, such as 2006-06-23 00:00, what I did wrong?

    Why not just have a hidden item with the ID so that when you create (insert) it is null and you insert sysdate and when you are editing an existing value and hence have the ID you update. This logic is easy to place in a page process (when the page is submitted)

  • How can assign the value returned from javascript to Hidden item

    Hi All,
    I have created a report with button in one column adding following code to SQL select statement like
    SELECT USER_RQST_ID, USER_RQST_DESC, RQST_DATE, STATUS, USER_ID, CNTRY_ID, KPI_LIST, YEAR_LIST, QTR_LIST, MONTH_LIST,
    PROD_LIST, FULL_PERIOD_FLG, GEN_DATE, '<input type=button value="view_list" onclick="javascript:doSubmit('||USER_RQST_ID||');">' button FROM KPI_USER_RQST;
    Then i have implemet doSubmit() function in Javascript like
    function doSubmit(req_id)
    html_GetElement('HIDDEN_ITEM')= req_id.value;
    Here HIDDEN_ITEM is the name of the item, I want to use that HIDDEN_ITEM value in PL/SQL block like...
    BEGIN
    INSERT INTO SAMPLE(KEY) VALUES(:HIDDEN_ITEM);
    END;
    But it is not working, Please help me anybody know the solution How to assign an item in javascript block function.
    Thanks,
    Neel

    Hello,
    doSubmit() is one of the built in javascript functions in apex and it's a bad idea to override it unless you know exactly what you are doing, and even then is a generally bad idea.
    change your function to this
    function mySubmit(pValue){
    $x('HIDDEN_ITEM').value = pValue;
    doSubmit();
    then your onclick will look like this notice the lack of the javascript: and the three ''' quotes to get the proper quotations for your value.
    onclick="mySubmit('''||USER_RQST_ID||''')"
    And there you go
    Carl

  • Add an ability to set password for hidden items

    Password foe hidden item in swip menu

    In other words you want to be able to hide folders from the album app and only be able to access them through a password
    "I'd rather be hated for who I am, than loved for who I am not." Kurt Cobain (1967-1994)

  • Setting an item value before print report in BI Publisher

    Hi,
    I am having an issue with setting a page item's value once a button (that prints a BI Publisher report) is pressed. The session state for the item is set, however because the page does not re-load no value appears in the item on the page.
    I am using a button as a page Item and using a Page Branch with the Branch Point set as On Submit: After Processing(After Computation, Validation, and Processing) with the Page set to 0 and the Request set to PRINT_REPORT=REPORT
    Is there any way to set the item value on the page before branching to the report?
    Your help is greatly appreciated.
    -Marsha

    Marsha,
    You can do that as follows:
    1- create a hidden text item (P20_date_hidden) with default value set to sysdate.
    2- for your button >> edit >> Buttom display attributes >> attributes >> type in : onFocus= "set_date();" (( note: am using onFocus because it takes places before onClick ))
    3- In your page >> edit >> HTML header >> type in :
    <script language="JavaScript" type="text/javascript">
    function set_date()
    v_date = $x('P20_DATE_HIDDEN').value;
    $x('P20_DATE_LETTER_SENT').value = v_date;
    </script>
    Hope this helps,
    Sam
    Please reward good answers by marking them correct or useful!

  • HTML tags in Hidden Item not displaying correctly

    I have created a HTML Text Region which includes a Javascript function. The function references a Hidden Item also created and linked to the region. The Hidden item returns a text field from the database with concatenates multiple rows together into a single string with HTML tag -br- between each row.
    The tags are not been recognised as HTML tags and is displayed :-
    -br-Record 1-br-Record 2-br-Record 3-br-'
    I want the page to display :-
    Record 1
    Record 2
    Record 3
    Any ideas?
    Message was edited by:
    pjturley
    Message was edited by:
    pjturley
    Message was edited by:
    pjturley

    Hello,
    Check to make sure you don't have those items set to escape html.
    Past that are you sure your javascript is putting in the &lt;br /&gt; tags correctly? before you submit fire a alert that shows the value of the hidden item and make sure it's correct there.
    Carl

  • Set Unit-item in Cube

    Hi
    I take unit-item for other object table.
    and I want to set unit-item in cube.
    but I don't understand where input.
    Please tell me where input part in cube.
    sorry  a little englishskill...

    Hi,
    If you are on Apex 3.x or higher , try
    function getTheCurrentRow(triggerItem){  
    alert( triggerItem.slice(6));
    $s("P4_SELECT", triggerItem.slice(6));   
    /* Alert hidden item value you did set */
    alert($v("P4_SELECT"));
    </script>Here is link to Apex JavaScript API document where you can find functions $s and $v I did use
    http://download.oracle.com/docs/cd/E14373_01/apirefs.32/e13369/javascript_api.htm#CDEEIGFH
    Regards,
    Jari

Maybe you are looking for

  • Accounting document no. in Excise part II register

    What work around needs to be done to get accounting document no. in excise registers or part II sl. No. in Accounting document. BSR

  • Transfer from Classic to Nano

    Does anyone know if it is possible to transfer music directly from an 80g Classic to a 4g Nano?

  • HELP!!! N91 Backup Error!!!!!

    Hi there, I have a nokia N91 4GB, I kept getting the message Memory low delte data, so I started going through file manager & deleting qiute alot of files & I think I might have deleted a file which affects the funtions on the phone! I cant open any

  • Report Parameter Forms

    Hello, I am currently developing an app using JHeadStart. This project will be using Jasper for reporting. I need to develop parameter forms and I was wondering if it would be good practice to use JHeadStart to generate these. I would create view obj

  • Javascript Parameters containing Apostrophes

    Hi, Hoping someone can assist, within a report column link attribute, I have the following information set-up: Target: URL URL: javascript:performDelApr('#First Name#','#Last Name#','#Login#'); Obviously, these are my report columns that I want to pa