How to add a value(text) from javascript to html:option tag .....

How to populate the <html:option> tag dynamically
I have a tree view, in tree view tag ( <layout:maeuItem> tag i have written "onclick " event )
<layout:menuItem key="${agrovoc.AGURI}" link="#"
                                   onClick="return copyVal(this)">
<script language="javascript" type="text/javascript">
               function copyVal(obj){
               str= obj.innerHTML; 
               l = str.length-4;
               xyz= str.substring(12,l);
               document.getElementById('agrovoc').value =document.getElementById('agrovoc').value + xyz+'\n';
               </script>Here "xyz" contains the Term ( the term clicked in the tree view) now i want add these terms ( clicked in tree view) into <html: option> tag.... how to do this.. plz give me some ideas
<html:select  property="agrovocbuffer" size="10" >
                    <html:option value="" styleId="agrovoc1"></html:option>
                    </html:select>

Hi,
i have tried with this, it's works fine... but when i click on the next page ( i mean 2 or 3 page etc ) the content of <html:option> are erasing (deleting).. i wanted those terms wht i have selected in the 1st page to remain in <html:option> when i click on 2 nd page also...
Tree view code
<layout:menuItem key="${agrovoc.AGURI}" link="#"
                                   onClick=" copyVal(this)">JavaScript
<script language="javascript" type="text/javascript">
                var i=0;     
                var myArray=new Array();
               function copyVal(obj){
                    var flag=0;     
               str= obj.innerHTML; 
               l = str.length-4;
               xyz= str.substring(12,l);
               while (xyz != null) {
               for( var l=0;l<myArray.length;l++){
               if( myArray[l]==xyz){flag=1;alret("The Term is already selected.");}
               if(flag!=1){
               document.getElementById('agrovoc').options[i] =new Option(xyz,xyz);
               myArray=xyz;
               i++;
               //alert(i);
               xyz=null;
               function del(){
                              var oc=document.getElementById('agrovoc').options;
                              //alert(oc.length);
                              firstBox = document.getElementById('agrovoc');
                              selectedOption = firstBox.options[firstBox.selectedIndex].value;
                              selected = firstBox.options[firstBox.selectedIndex].index;
                              //alert(selected);
                              for( var l=0;l<myArray.length;l++){
               if( myArray[l]==selectedOption){myArray[l]="";}
                              firstBox.options[firstBox.selectedIndex] = null;
                              var oc=document.getElementById('agrovoc').options;
                              //alert(oc.length);
                              for(var x=selected;x<oc.length;x++,selected++)
                              document.getElementById('agrovoc').options[x] =new Option(firstBox.options[selected].value);
                              i=oc.length;
               </script>
<html:select> code<div align="left" id="hopt">     
               <td valign="top">
               <logic:present name="hcount">
                    <html:select property="agrovocbuffer" size="15" styleId="agrovoc" multiple="true" style="width:200px;" >
                    <html:option value="" ></html:option>
                    </html:select><html:button property="button" onclick="del()"> DEL</html:button>
               </logic:present>
               </td>
               </div>
And all the above code is in <html:form> tag & i have written a custom pagination page
Now i want  all terms which are in <html:option> remain  in options when i goto 2 nd page..
how to do this? In the DOM inspector i'm getting the options, but when see the source HTML there are no <html:options>.. when click on the 2 page link the terms which are in <html:option> are not going to the "Action" class ..  :(
how to do this .. any idea plz..?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • 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

  • How can I submit the page from javascript in html header?

    I followed
    http://www.oracle.com/technology/products/database/htmldb/howtos/htmldb_javascript_howto2.html#client
    It says "doSubmit('Delete');" to submit the delete action.
    If I do the same in the java script that is embededed in html header, it does not work.
    I am assuming 'Delete' is the name of the button here.
    I also tried:
    document.forms[5].submit(); --> does not work
    document.formname.submit(); --> does not work
    I want to know:
         how I get the form name. I am assuming that this is the name in Name field in "Page definition" or is this page number?
         how to sumit a form from the javascript in html header

    sudheshna,
    function deleteConfirm(msg)
    should be
    function Confirmdelete(msg)
    cheers
    KIM

  • How to add multi-line text in comments field of song tags in iTunes 12?

    Recently upgraded to iTunes 12 and can no longer enter multi-line text in the comments field of a song tag.  Used to use option+return (alt+enter) to go to a new line (carriage return).  Can it still be done?  Any help in this regard would be appreciated.

    See my other post for the solution to this problem.

  • How can i add the value inputted from the prompt box to the mysql database?

    Hey guyz help me pls with this problem... im only new to javascript and also to the opensource like(php and mysql). I tried to use a prompt box and store the value into the textbox. But now I want to know how to insert/add the value inputted from a prompt box directly into the database if it is possible.

    Java is not JavaScript, they've got almost nothing in common (apart from superficial syntax similarities and the first 4 letters of their names).
    If indeed your question is about JavaScript, then please find a JavaScript forum, as we can't help you here.

  • How to add a scrolling text in portrait with iMovie

    how to add a scrolling text in portrait with iMovie

    This is how i was able to do it. Edit html source.
    <div align="center"><marquee id='scroll_news4' bgcolor=#ff9966 "><font color="#000000" size="+1" ><strong>Outlook is down! IT is working on it! </strong></font></marquee></div>
    <input type='Button' value='Stop' id ='b1' onClick='button_click()';>
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    function button_click()
    if(document.getElementById('b1').value=="Start"){
    document.getElementById('b1').value="Stop";
    document.getElementById('scroll_news4').start();
    }else{
    document.getElementById('b1').value="Start";
    document.getElementById('scroll_news4').stop();
    // End -->
    </script>

  • I want to add same value/text in every cell in a column in Numbers 3.0

    I want to add same value/text in every cell in a column.  For example, in all my file names are for pictures that are uploaded to a host site, but the name in the cell does not include the URL associated with it.  Does anyone know how to be able to add text to a whole column in front of the current text already in that column?

    Assume the filenames are in column C.
    Let's says you want to add the text before each file name  "http://www.apple.com/"
    add a new column (let's say D) and add the formula:
    D1="http://www.apple.com/"&C
    this is shorthand for... in cell D1 type (or paste from here) the text ""http://www.apple.com/"&C" without the first and last double quotes
    select D1, copy
    select the column D by clicking the letter D at the top of the column, paste
    The "&" is called the concatenate operator and joins two strings together

  • How to pass text from flash to html?

    how to pass text from flash to html?

    This is a wonderful sample i found online.
    pls run using a server so that it can display properly
    http://active.tutsplus.com/tutorials/actionscript/flash-html-javascript-externalinterface/

  • How to call jpf controller method from javascript

    Can any one help me how to call pageflow controller method from JavaScript.\
    Thanks.

    Accessing a particular pageflow method from Javascript is directly not possible unless we do some real funky coding in specifying document.myForm.action = xyz...Heres what I tried and it did not work as expected: I found another workaround that I will share with you.
    1. In my jsp file when I click a button a call a JavaScript that calls the method that I want in pageflow like this: My method got invoked BUT when that method forwards the jsp, it lost the portal context. I saw my returned jsp only on the browser instead of seeing it inside the portlet on the page of a portal. I just see contents of jsp on full browser screen. I checked the url. This does make the sense. I do not see the url where I will have like test1.portal?_pageLabe=xxx&portlet details etc etc. So this bottom approach will notwork.
    document.getElementById("batchForm").action = "/portlets/com/hid/iod/Batches/holdBatch"; // here if you give like test1.portal/pagelable value like complete url...it may work...but not suggested/recommended....
    document.getElementById("batchForm").submit;
    2. I achieved my requirement using a hidden variable inside my netui:form tag in the jsp. Say for example, I have 3 buttons and all of them should call their own action methods like create, update, delete on pageflow side. But I want these to be called through javascript say for example to do some validation. (I have diff usecase though). So I created a hidden field like ACTION_NAME. I have 3 javascript functions create(), update() etc. These javascripts are called onclick() for these buttons. In thse functions first I set unique value to this hiddent field appropriately. Then submit the form. Note that all 3 buttons now go to same common action in the JPF. The code is like this.
    document.getElementById("ACTION_NAME").value = "UPDATE";
    document.getElementById("batchForm").submit.
    Inside the pageflow common method, I retriev this hidden field value and based on its value, I call one of the above 3 methods in pageflow. This works for me. There may be better solution.
    3. Another usecase that I want to share and may be help others also. Most of the time very common usecase is, when we select a item in a drop bos or netui:select, we want to invoke the pageflow action. Say we have 2 dropdown boxes with States and Cities. Anytime States select box is changed, it should go back to server and get new list of Cities for that state. (We can get both states and cities and do all string tokenizer on jsp itself. But inreality as per business needs, we do have to go to server to get dynamic values. Here is the code snippet that I use and it works for all my select boxes onChange event.
    This entire lines of code should do what we want.
    <netui:anchor action="selectArticleChanged" formSubmit="true" tagId="selectPropertyAction"/>                    
    <netui:select onChange="document.getElementById(lookupIdByTagId('selectPropertyAction',this )).onclick();" dataSource="pageFlow.selectedArticleId" >
    <c:forEach items="${requestScope.ALL_ARTICLE}" var="eachArticle">
    <%-- workshop:varType="com.hid.iod.forms.IoDProfileArticleRelForm" --%>
    <netui:selectOption value="${eachArticle.articleIdAsString}">${eachArticle.articleItemName}</netui:selectOption>
    </c:forEach>               
    </netui:select>
    See if you can build along those above lines of code. Any other simpler approches are highly welcome.
    Thanks
    Ravi Jegga

  • How to add integer value of two buttons?

    how to add integer value of two buttons (any button) in VI and display it in output text box? i have attached example program, but i know its wrong.. please help
    Solved!
    Go to Solution.
    Attachments:
    add.vi ‏8 KB

    thanks for reply. i am trying to assign an integer value to a button and the button should send the assigned integer value to TCP/IP write, only when the button is pressed. i am able to send data using string control (as shown in the attachment) but i want to replace it with several buttons. for example, if i enter 2 in string control, this data will be sent to a robot (robot has wifi card)  through tcp/ip protocol, it moves front. 3 will make it to move back, 8 is left, 6 is right. this numeric data is already burnt into blackfin processor of the robot. so just by entering numbers in labview can make my robot move in specified direction. can you please help me to create a button with value and convert it into string and send it to tcp/ip write. this should happen only when the button is pressed. because, if i enter numbers in string control, it dosent looks good..... if i have buttons... i think my VI will look good and hitech.
    Attachments:
    robo.vi ‏9 KB

  • How to add two values

    How to add varchar values in oracle.Consider as both are time values.but the data type[both] is varchar and stroed in table
    For example:
    Column1 Column2
    2.40:10 PM 5:22:00
    i need the result for the following format
    8.02[8 hours and 2 minutes]

    with c as
    (select '2:40:10 PM' t1, '5:22:00 PM'  t2  from dual)
    select hr+level ||':'||to_char(mi - (level*60))||':'||sc Time from
        select  sum(h) hr,sum(m) mi, sum(s) sc from
            (select
                    substr(t1,1,instr(t1,':',1)-1) h, substr(t1,instr(t1,':',1)+1,instr(t1,':',2)) m, substr(t1,instr(t1,':',3)+1,instr(t1,':',3) - instr(t1,':',2)) s, substr(t1,-2) t
            from c
            union
            select
                    substr(t2,1,instr(t2,':',1)-1), substr(t2,instr(t2,':',1)+1,instr(t2,':',2)), substr(t2,instr(t2,':',3)+1,instr(t2,':',3) - instr(t2,':',2)), substr(t2,-2)
            from c
    connect by level<(mi-60)
    TIME
    8:2:10

  • How to add exiting event listener in javascript

    I am trying to figure out how to add an event listener in javascript for the exiting event when the red x is clicked on a Windows window (top right corner).
    I found this among adobe documentation, but it does not work:
    var app = air.NativeApplication.nativeApplication;
    app.addEventListener(air.Event.EXITING, closeHandler);
    function closeHandler(event) {
      alert("Goodbye.");
    And yes I have the AIRAliases.js included.
    Thanks

    The code posted above is from page 10 of the "HTML Developer’s Guide for ADOBE AIR (prerelease updated 11/16/2009)".
    I am actually exiting the program because I only have one window open and I click on the red x in the top right corner to shut it down... in theory, the example above provided by Adobe, should interrupt the exit sequence by displaying an alert box amd then shut the program down.
    Here's the excerpt from the manual...
    unload events (for body and frameset objects)
    Adobe AIR 1.0 and later
    In the top-level frameset or body tag of a window (including the main window of the application), do not use the unload event to respond to the window (or application) being closed. Instead, use exiting event of the NativeApplication object (to detect when an application is closing). Or use the closing event of the NativeWindow object (to detect when a window is closing). For example, the following JavaScript code displays a message ("Goodbye.") when the user closes the application:
    var app = air.NativeApplication.nativeApplication;
    app.addEventListener(air.Event.EXITING, closeHandler);
    function closeHandler(event)
    alert("Goodbye.");
    However, scripts can successfully respond to the unload event caused by navigation of a frame, iframe, or top-level window content.
    Note: These limitations may be removed in a future version of Adobe AIR.

  • How do I receive multiple texts from the same sender, each individually?

    How do I receive multiple texts from the same sender, each individually?

    So I receive automated reminders from my job &amp; I want them to come individually. For example, one text -- time stamped 10:14 pm, then another 11:12 am, coming as separate msgs.

  • How can i remove JUNK TEXT from APEX

    Hi ,
    In our project Apex has integrated with oracle apps,every time we will open apex front end from oracle application(EBS).so we have two kinds of instances 1) development and other is production
    every time we export the apex application from developement instance and import in production instance . after imported into production * we got JUNK TEXT like "TEXT:TEXT" in apex front end* so how can i remove JUNK TEXT from APEX
    Apex 4.0.0.00.46 version
    please somebody help on this issue
    Help would be appreciated
    Regards
    Narender B

    Hi,
    It is not clear what you are seeing here. Also we don't know how you have integrated Apex with EBS. My guess is you have linked an Apex page to the EBS menu and when you click on the menu link you see the additional text on the Apex page.
    You need to give details of how you have integrated Apex with EBS and where and when this additional text is being displayed for me to give you any help on this issue.
    Rod West

  • How can I access xml document from javascript whithin a JSP page

    how can I access xml document from javascript whithin a JSP page?
    I have a JSP that receives an XML document from a JavaBean, so I can access it within the entire JSP, but I need to access it from the javascript inside the JSP... and I have no idea how i can do this.
    Thanks in advance!

    The solution would only work on MS IE browsers, as other browsers do not support an XML DOM.
    It can be done, but you would be stuck with using the Microsoft broswer. If that is acceptable, I have some example code, and a book recommendation.

Maybe you are looking for

  • Is there a way to create links to certain parts of a video?

    I would like to have links at certain time stamps within my video (which is a recording of my screen I did not use Power Point), this way I can call out important points and the viewer can go straight to them. Is this possible in Adobe Presenter 9?

  • Problem in Mapping RefCursors(in/out parameter) and Collections(in/out)

    Hi, Can anyone help to solve the proble listed below as it is affecting the business process The API for A is listed below. It takes Oracle Object types as input/output. PROCEDURE A( p_serviceOrder IN ServiceOrder, p_serviceID IN OUT p_sm_type.Servic

  • Implementation of Shared Libraries on Palm Using J2ME

    Hi, I am currently working on the Palm Shared Libraries using C...Kind of drag....so I wonder is there any way to implement this on the Palm using J2ME... Thanks and Regards, Joseph

  • Doubt in SOST and SOSB

    Hi Experts, I am working in SAP 4.6c version. Requirment: This is about issuing output for an output type of Sale order and check the email log in SOST and SOSB. For a sale order, the CSR partner will have an email address maintained. This email addr

  • Blend mode on a button or graphic symbol being drop when symbol placed

    If i apply a blend mode to an object in a symbol or button, and i place an instance of that somewhere it drops the blend mode. e.g.: create a button with a gradient overlaying a solid colour, set the grad to "overlay" in blend mode. Then convert to s