HTML DB Items Using JavaScript

I have a page that is based on a SQL Query (PL/SQL Function Body Returning SQL Query). If I call another page from one of the items using a URL such as
f?p=&APP_ID.:6:#APP_SESSION#::::P6_ID:#ID#
it calls the new page fine.
If I try and call it using the example in :
http://www.oracle.com/technology/products/database/htmldb/howtos/how_to_create_custom_popups.html
So change it to have an HTML expression of :
<a href="javascript:callMyPopup('ID');">Notes</a>
the ID never seems to be seen.
If i do an function callMyPopup (formItem1) {
var formVal1 = document.getElementById(formItem1).value;
alert('value is ' || formVal1);
the values is also not displayed.
This is the first time I have tried to use Javascript, is my problem because the ID is part of the Query rather than a static field ?
Thanks
Paul

Hello Paul,
Your JavaScript function will not work properly because you try to pass a form item value to that function. But you are calling the function from a query.
Try the following:
First, change the URL from:
f?p=&APP_ID.:6:#APP_SESSION#::::P6_ID:#ID#
to:
javascript:callMyPopup('#ID#');
Second, change the link text from:
<img src="#IMAGE_PREFIX#...>
to:
Note
Third, change your JavaScript function:
function callMyPopup (qvalue) {
alert('value is ' + qvalue);
Regards,
Tom

Similar Messages

  • How to validate an text field item using javascript for numbers only.

    hi,
    how to validate an text field item using javascript for numbers only.please help me on this urgent
    please mail me solun if posible on [email protected]

    Hi,
    Page HTML header
    <script>
    function onlyNum(evt) {
      // Usage: onKeyPress="return onlyNum(event)"
      evt = (evt) ? evt : window.event;
      var charCode = (evt.which) ? evt.which : evt.keyCode;
      if (charCode > 31 && (charCode < 48 || charCode > 57)) {
        var status = 'This field accepts numbers only!';
        alert(status);
        return false;
      var status = '';
      return true;
    </script>Item HTML Form Element Attributes
    onKeyPress="return onlyNum(event)"Br,Jari

  • 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
    -------------------------------------------------------------------

  • Overwriting the value of an html:hidden tag using javascript

    Hi!
    Can somebody help me with my problem?
    I need to overwrite the value of my html:hidden tag using javascript, but I dont know how?
    Any help?
    Thanks

    what are you talking about :x
    thats a webapplication question, wrong forum..
    But you are using STRUTS I would say...
    <html:hidden property="hiddenfield"/>This is the proper way of doing it.. but overrighting it
    I don't think you understand why we use that?
    It is only for forms.... we use that for hidden input ... It is common sence not to overrde that value.

  • How to hide/disable menu items using Javascript in Acrobat 9 pro or later

    We just wanted to know on how to hide/disable menu items for e.g. 'Open' menu item under 'File' menu in Acrobat 9 or later on Mac using Javascript. It would be useful if you could provide if any other option is in place already.

    Not sure it will work, but you can try using the app.hideMenuItem() method. See reference here.

  • Add attachments to List Item using JavaScript Client object model in SP2010

    Hi All ,
    I have created custom form for submitng data in list using javascript client object model/jquery .
    Now I want to add option to uplaod multiple attachments to that list item also .
    Is there option with client object model for uplaoding attachment.
    Thanks
    M
    Manesh G

    Can you try this and let me know
    using (SPSite _site = new SPSite(SPContext.Current.Site.Url))
        using (SPWeb _web = _site.OpenWeb())
         //Let's suppose your Item Id is 1
         int ItemId = 1;
         SPList  oList = _web.Lists["EmployeeList"];
         SPListItem  _item = oList.GetItemById(ItemId);
         if (FileUpload1.HasFile)
               _web.AllowUnsafeUpdates = true;
              Stream fs = FileUpload1.PostedFile.InputStream;
              byte[] _bytes = new byte[fs.Length];
              fs.Position= 0;
              fs.Read(_bytes, 0, (int)fs.Length);
              fs.Close();
              fs.Dispose();
              _item.Attachments.Add(FileUpload1.PostedFile.FileName, _bytes);
              _item.Update();
              _web.AllowUnsafeUpdates = false;

  • 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

  • How to get the return value of a LOV item using javascript

    Hello,
    I am trying to put an onchange attribute in the HTML Form Element Attributes field of a LOV item. The javascript should access the new return value of the item. How is this done ? All the methods I have tried give only the display value, not the return value. For example $v() returns the display value.
    Tiina

    If your item is called P1_ITEM this will give you the return value of a popup (displays description,returns key value)
    alert($x('P1_ITEM_HIDDENVALUE').value)
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • How to display Session value of an item  using Javascript?

    Hello All,
    I have a file browse item and I browse some file and click on upload, i run this javascript :
    function passBack()
    javascript:doSubmit('UPLOAD');
    alert('hi');
    var var_flag = $x('P91_FILE');
    alert(var_flag.value);
    opener.document.forms["wwv_flow"].f05[3].value = var_flag.value;
    close();
    </script>
    It dispalys 'hi ' as per the first alert.
    For the second alert it shows the file path value . ( C:\test\test1.sql).
    I need the file session value to be displayed here
    Like the following :
    F477093380/test1.sql
    and then I need to pass that value to parent page. and close the child page.
    Any idea?
    Thanks in advance.
    Regards,
    Archana

    Archana,
    I'm not sure about javascript, but u can use a sql query on the "APEX_APPLICATION_FILES" view to obtain that.
    Something like:
    SELECT id,NAME
      FROM APEX_APPLICATION_FILES;

  • Toggling an Image attached to an Item using Javascript

    Hi,
    Hoping someone can assist, I have the following html in the Post Element section of a page item, i.e:
    NOTE: I have had to remove angle brackets - can't seem to get the formatting right.
    td colspan="1" rowspan="1" align="top" onClick="getMAGDets();" img
    src="#WORKSPACE_IMAGES#go_arrow.gif" border="0" alt="Retrieve
    applicant details" height="14" width="14" style="cursor:hand"
    td colspan="1" rowspan="1" align="left"
    onClick="resetAppDets();" img src="#WORKSPACE_IMAGES#icon_err.gif"
    border="0" alt="Clear applicant details" style="cursor:hand"
    img src="#WORKSPACE_IMAGES#btn_nuid.png"
    onClick="toggleNUImage(this);" align="top" border="0" alt="Supply a
    Non-User ID" style="cursor:hand"
    Now I am able to toggle the bottom image as follows:
    function toggleNUImage(x)
    if (x.src = (x.src.indexOf("#WORKSPACE_IMAGES#btn_nuid.png") > -1))
       x.src = "#WORKSPACE_IMAGES#btn_hide_nuid.png";
       x.alt= "Hide Non-User ID details.";
    }My problem is, when I load the record I have just created, on the onload event, it defaults to the btn_nuid.png image, I actually would like it to default to the btn_hide_nuid.png.
    How would I go about doing this and how would I also go about actually not showing this image at all that I have attached to an item within it's post element property?
    Thanks.
    Tony.

    Hi Rana,
    FYI, it's actually part of my post element field within an item - it's not a separate button. Only way to achieve what I would like to do, is via javasript. Cannot use the conditional display section.
    Just not familiar with the syntax.
    Tony.

  • Indesign Scripting: How can I move a placed item using Javascript?

    Hey all,
    I have been trying to write a script that places a slug object from an indesign library on to a document and then moves it to my slug area. It all seems to work except the move command. I think the problem is that I haven't selected my placed asset correctly.
    Please help!
    This is what I have so far:
    //Create new document
    var doc = app.documents.add();
    // Get page size values
    var w = doc.documentPreferences.pageWidth;
    var h = doc.documentPreferences.pageHeight;
    //Create layer called SLUG
    var slugLayer = doc.layers.add({name:"SLUG"});
    //Set document slug area size
    doc.documentPreferences.documentSlugUniformSize = false;
    doc.documentPreferences.slugBottomOffset = "20 mm";
    //Open InDesign library file that contains the slug file
    var slugLibrary = app.open(File("/Users/Shared/Slug.indl"));
    //Place slug script to go here
    var myPlacedAsset = slugLibrary.assets.item("Slug");
    var mySlug = myPlacedAsset.placeAsset(doc);
    //Close the slug library
    slugLibrary.close();
    // Move slug object to slug area
    mySlug.move([0,0]);
    //Lock SLUG layer
    slugLayer.locked = true;

    placeAsset is an array so this line :  mySlug.move([0,0]);
    should be changed to: mySlug[0].move([0,0]);

  • How to read application item's value using  javascript

    Is there any way to read value of application item using javascript?
    Thanks

    Javascript can access the objects rendered for the page you are calling. This is why the $v function will do the work if calling it for a page item. However an application item isn't rendered on the page - the session state of it is only stored in the table. This is why you need to do it the way I described. You could do a workarround and create a hidden item on your page and compute the value of it using the application item value. Then you would be able to get the value of your application item using $v function.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    ------------------------------------------------------------------------------

  • How to populate an application item using ONCHANGE.

    I am trying to populate an application item, TAB_INSTATE using an onchange command. I cannot figure out how to do it. Does anyone know the syntax, or can you point me in the right direction. I am unfamiliar with javascript and have been relying on previous examples, posts. thanks
    apex_item.select_list_from_query
    (20,
    c020,
    'select partner_name, partner_abbrev
    from partners
    where state_code is not null order by partner_name ',
    'style="width:100px"'
    || 'onchange="'
    || CASE
    WHEN :p300_authorization1 = 1
    THEN 'f_set_casc_area(this,f21_'
    || LPAD (seq_id, 4, '0')
    || ');'
    ELSE
    <THIS IS WHERE I WOULD LIKE A THE VALUE OF c020 TO BE PLACED INTO :TAB_INSTATE>
    END
    || 'f_set_casc_subarea(this,f22_'
    || LPAD (seq_id, 4, '0')
    || ')"',
    'YES',
    '0',
    '- Select State -',
    'f20_' || LPAD (seq_id, 4, '0'),
    NULL,
    'NO'
    ) in_state,

    Hello Karen,
    >> I am trying to populate an application item, TAB_INSTATE using an onchange command.
    I believe I answered you in here - Re: once more...4 cascading LOVs, 3rd is hidden 4th no longer works However, for future reference…
    You don’t have a direct access to an application item, using JavaScript, because application items don’t render on page. You can, however, using the AJAX framework to do that, using the add() method. The generic code I’m using is the following:
    <script type=”text/JavaScript”>
    function setSessionValue(pItem, pValue) {
      var get = new htmldb_Get(null,html_GetElement('pFlowId').value,null,0);
      get.add(pItem, pValue);
      get.get();
      get = null;
    </script>This code can set any page or application item value.
    Regards,
    Arie.

  • How to Insert user selected files as list attachment using JavaScript?

    I could able to Inset list items using ECMA Script, But for the user added attachment how to save it to list item.
    Please help

    check the similar post
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/3d92510f-f966-45b2-989d-734ba21c5ce5/how-to-attach-file-to-list-item-using-javascript-in-sharepoint-2010?forum=sharepointcustomizationprevious
    More links
    http://sharepoint.stackexchange.com/questions/88487/using-sharepoint-client-api-to-upload-file-as-attachment-in-javascript
    http://sharepoint-community.net/forum/topics/copy-attachments-of-sharepoint-list-item-to-a-document-library

  • Reading web items in javascript.

    In a 7.0 template, how can I read the value of a web item using javascript? I want to read a filter value from the info field item, manipulate it and assign the resulting value to an input item. How do I access the value?

    Hello Bharath,
    There is a webitem called Navigation pane in the Standard list, i hope this is what you need.
    Kindly reply again is your problem is not resolved and please assign points if it is :).
    Regards,
    Dennis

Maybe you are looking for