Getting hidden value with javascript problem

<html>
<body>
<form>
<input type="hidden" id="code" value="123">
</form>
</html>
when open the html file and type "javascript:alert(document.getElementById("code").value)" in the address bar, I get a message box with "123".
but when i do in the jsp with
<input type="hidden" id="code" value="<%=request.getParameter("code")%>">
and type the javascript in the address bar, i get "object not supported".
Can anyone tell me how to get hidden value in jsp with javascript?
thank you.

There is no difference between a JSP or plain html, since javascript executes on the client side after the JSP is done processing. There is obviously something wrong with the HTML content after you input the request value, so check the generated HTML in your browser to see if there are any unwanted quotes in there or something.

Similar Messages

  • Change "choiseListe" values with javascript

    Dear,
    Is it possible to change "choiseListe"  values  with javascript.
    Exemple il have a choseListe :
         Country //// Values
          USA            us
          France         fr
          Spain           sp
    When il click in a botton i whant to change this choceListe :
         Country //// Values
          Morocco           ma
         Portugal           pt
    Thanks

    Hi,
    Listboxes and dropdowns can be scripted against without too much difficulty.
    You would need something like this in the click event of the button:
    listbox1.rawValue = null; //clear previous choice
    listbox1.clearItems(); //clear the list items
    listbox1.addItem("Moocco", "ma"); //add new list items
    listbox1.additem("Portugal", "pt");
    Hope that helps,
    Niall

  • HibernateSystemException: exception getting property value with CGLIB

    I am getting a hibernate exception error
    HibernateSystemException: exception getting property value with CGLIB
    does anyone know what it means?

    check the setter method for the property LANG_CD in com.dst.fourx.model.codeModel.CodeGroupDisplay.
    it must be like -
    setNlsLanguage(CodesGroup xyz) { ... }
    The paremeters must be objects, not the type of the database column. We can specify the actual field in CodesGroup which acts as the foreign key in CodeGroupDisplay in the "property-ref" attribute of <many-to-one> element in the mapping file for CodeGroupDisplay.
    This worked for me. Hope it works for you too.

  • Sign on problems within Elements 10; plus cannot backup writing files error with file catalog.pse10db.  No indication what the problem is.  How do I get adobe help with these problems?

    Sign on problems within Elements 10; plus cannot backup, writing files error with file catalog.pse10db.  No indication what the problem is.  How do I get adobe help with these problems?

    Sign on problems within Elements 10; plus cannot backup, writing files error with file catalog.pse10db.  No indication what the problem is.  How do I get adobe help with these problems?

  • How can i get the h:selectOneRadio value with javascript

    Hi all.
    I have this code
    <h:selectOneRadio id="color" style="font-family: Arial;font-weight:lighter;font-size: 12px" onclick="showColor()" >
    <f:selectItem itemLabel="RED" itemValue="1" />
    <f:selectItem itemLabel="BLUE" itemValue="2" />
    </h:selectOneRadio>
    And javascript function is
    function showColor()
    var tipoRelacion = document.getElementById("form:color").value;
    alert("color" + tipoRelacion);
    And what i get is that color is undefined. How can i get the value of the selected radio?
    Thanks a lot

    you just need to pass this while calling javascript function
    check this-
    <h:selectOneRadio id="color" style="font-family: Arial;font-weight:lighter;font-size: 12px" onclick="showColor(this)" >
    <f:selectItem itemLabel="RED" itemValue="1" />
    <f:selectItem itemLabel="BLUE" itemValue="2" />
    </h:selectOneRadio>
    And javascript function is
    function showColor(obj)
    var val = obj.value
    alert("color" +val);
    }

  • Capturing form values with javascript (not working in Safari!)

    Hi
    I'm working on a site and I need to be able to take the values of one form (that the user has entered) and use them to populate a second form (more details) in the appropriate input boxes. This works on all browser except Safari. It seems to me a javascript problem (as getElementById does not work properly) but I'm not entirely sure. The code I use to grab the form elements is as follows:
    obj = $('formslider".$this->id."');
    obj.getElementById('registerfirstname".$this->id."').value = callbackfirstname".$this->id.";
    obj.getElementById('registersurname".$this->id."').value = callbacksurname".$this->id.";
    obj.getElementById('registeremail_addr".$this->id."').value = callbackemail".$this->id.";
    obj.getElementById('registertelephone".$this->id."').value = callbacktelephone".$this->id.";
    obj.getElementById('registerrequest_type".$this->id."').value = requesttype_callback".$this->id.";
    This basically takes the values of the "callback" form and places them into the appropriate input boxes of the "register" form. However it seems to lose the values when moving to the next form. Please note, I am not refreshing - I am using Ajax to change the form so new content simply replaces an existing content, not transfering to another page. I use Sessions so it shouldn't forget the values.
    Can anyone help? It's quite an important thing as I need to migrate hidden form inputs too which are needed for this particular request system.
    Thanks
    Michael

    I'm seeing this same issue in Mavericks, 10.9.2.  Althought JavaScript is enabled in Safari, it just doesn't work, for any pages.
    I've tried different user accounts, including a new account, on the same machine, but they all do the same thing, so it's a machine-wide issue.
    I have plenty of other Mavericks machines, including my own, where it is working just fine, however, with the same settings.

  • How to get a value from JavaScript

    How to get return value from Java Script and catch it in c++ code. I have tried following code, but its not working in my case.
    what I want is if it returns true then call some function if it returns false then do nothing, so how to get those values in c++
    ScriptData::ScriptDataType fDataType = resultData.GetType();
    if (fDataType == kTrue)
           CAlert::InformationAlert("sucess");
           //call some function
                        else
                                  CAlert::InformationAlert("Error");
         // do nothing
    JavaScript Code:
        if(app.scriptArgs.isDefined("paramkeyname1"))
               var value = app.scriptArgs.get("paramkeyname1");
               alert(value);
                return true;
      else
               alert ("SORRY");
               return false;

    How to get java script result into JSResult i m not getting it.
    I have wriiten follwing code in c++ :
              WideString scriptPath("\\InDesign\\Source1.jsx");
              IDFile scriptFile(scriptPath);
              InterfacePtr<IScriptRunner>scriptRunner(Utils<IScriptUtils>()->QueryScriptRunner(scriptFi le));
              if(scriptRunner)
                        ScriptRecordData arguments;
                        ScriptIDValuePair arg;
                        ScriptID aID;
                        ScriptData script(scriptFile);
                        ScriptData resultData;
                        PMString errorString;
                        KeyValuePair<ScriptID,ScriptData> ScriptIDValuePair(aID,script);
                        arguments.push_back(ScriptIDValuePair);
                        PMString paramkeyname1;
                        Utils<IScriptArgs>()->Save();
                        Utils<IScriptArgs>()->Set("paramkeyname1",scriptPath);
                        Utils<IScriptUtils>()->DispatchScriptRunner(scriptRunner,script,arguments,resultData,erro rString,kFalse);
                        Utils<IScriptArgs>()->Restore();
                        ScriptData::ScriptDataType fDataType = resultData.GetType(); // here i should get true or false which i m passing it from javascript code......not as s_boolean
                        if (fDataType == kTrue)
                                       //CAlert::InformationAlert("sucess");
                                     iOrigActionComponent->DoAction(ac, actionID, mousePoint, widget);
                        else
                                    this->PreProcess(PMString(kCstAFltAboutBoxStringKey));
    Java script code:
    function main()
           var scrpt_var;
           var scriptPath,scrptMsg;
           var frntDoc=app.documents[0];
           if(app.scriptArgs.isDefined("paramkeyname1"))
               var value = app.scriptArgs.get("paramkeyname1");
                alert(value);
                 return true; // i want this value i should get in c++ code...How to get these values in c++
           else
              alert ("Error");
              return false; // i want this value i should get in c++ code...How to get these values in c++

  • Change TextView value with Javascript

    Hello,
    I'm trying to find a way of changing the value of an HTMLB TextView on the client side with javascript.
    Do you know how to do that ? Cannot work it out...
    Many thanks
    Nicolas

    Hi,
    this can be a bit tricky, because you have to know, how to access the element. that means you need an unique id or an absolute position of the TextView-element
    if you can see, how to access the specific element in your client-pagesource, a possible javascript could be:
    document.getElementById("<id of element>").firstChild.nodeValue="My new Text"
    or access by name/count of the element:
    document.getElementsByName("<name of element>")[#position of occurance].firstChild.nodeValue="My new Text"
    kr, achim

  • Get the Values with null for all dates

    hi,
     i have a scanrio to get the sales trend. The data look like below
    CREATE TABLE #T1
    ( Item varchar(50),
    SalesDate Date,
    Quantity int
    INSERT INTO #T1 VALUES ('Item1', '2013/02/01', 3)
    INSERT INTO #T1 VALUES ('Item2', '2013/02/01', 5)
    INSERT INTO #T1 VALUES ('Item1', '2013/02/02', 2)
    INSERT INTO #T1 VALUES ('Item1', '2013/02/03', 6)
    INSERT INTO #T1 VALUES ('Item2', '2013/02/03', 4)
    SELECT * FROM #T1
    Here i have 2 items sales details for 3 days. So user can get the sales trend by passing StartDate and EndDate as 2 parameters.  But it will return the existing date values only. In this example Item2 not have sales record in the table for '2013/02/02'
    But needs to give null values in the select Query
    My Existing Output
    Item SalesDate Quantity
    Item1 2013-02-01 3
    Item2 2013-02-01 5
    Item1 2013-02-02 2
    Item1 2013-02-03 6
    Item2 2013-02-03 4
    My expected output is
    Item SalesDate Quantity
    Item1 2013-02-01 3
    Item2 2013-02-01 5
    Item1 2013-02-02 2
    Item2 2013-02-02 null
    Item1 2013-02-03 6
    Item2 2013-02-03 4
    Can you help to write the query. I wrote using CTE but if the ITem is single value its ok. But for multiple items how can i get the empty dates

    akhil,
    Check if this helps you:
    --CREATE TABLE #T1
    --( Item varchar(50),
    -- SalesDate Datetime,
    -- Quantity int
    --INSERT INTO #T1 VALUES ('Item1', '2013/02/01', 3)
    --INSERT INTO #T1 VALUES ('Item2', '2013/02/01', 5)
    --INSERT INTO #T1 VALUES ('Item1', '2013/02/02', 2)
    --INSERT INTO #T1 VALUES ('Item1', '2013/02/03', 6)
    --INSERT INTO #T1 VALUES ('Item2', '2013/02/03', 4)
    SELECT * FROM #T1
    declare @tab TABLE(date_col datetime)
    insert @tab select '2013/02/01'
    insert @tab select '2013/02/02'
    insert @tab select '2013/02/03'
    ;with cte
    as
    select * from
    (select distinct Item from #t1) a
    cross join
    (select date_col from @tab) b
    select c.item,c.date_col,t.Quantity from cte c
    left join #T1 t on c.Item=t.item and c.date_col=t.SalesDate
    You have the following options for the population of @tab (that decodes the dates for which values are to be obtained):
    either explicitly as i have done
    using a select statement on #T1 like, insert @tab select distinct SalesDate from #T1
    or for past three days means, something like - getdate(),getdate()-1 and getdate()-2
    Thanks,
    Jay
    <If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'>

  • Assigning a DataProvider filter value with JavaScript

    I have a "Fiscal Yr/Period" filter characteristic in my web application that I am assigning the value of the current month and year when the web application is loaded.  In other words, this filter is applied to the DataProvider when the application loads (code below):
    <object>
             <param name="OWNER" value="SAP_BW"/>
             <param name="CMD" value="SET_DATA_PROVIDER"/>
             <param name="NAME" value="C_LPR_Q018"/>
             <param name="QUERY" value="C_LPR_Q018"/>
             <param name="INFOCUBE" value="ZPP_C01"/>
             <param name='FILTER_IOBJNM' value='0FISCPER'/>
             <param name='FILTER_VALUE' value='H12004010'/>
             DATA_PROVIDER:             C_LPR_Q018
    </object>
    As you can see above, the value for the '0FISCPER' object is hardcoded and thus requires me to change this monthly.  I have written some JavaScript code to calculate the current mo. and yr. however I can't get my JavaScript variable that holds the value I need assigned to the FILTER VALUE.  Can I even assign a JavaScript variable as the filter value?  Is there another way?  Any help would be greatly appreciated.

    Hi Allen,
    if you want to change any param of an object, try the function SAPBWOpenURL, which should be sent against the object you want to change. Documentation is at :
    http://help.sap.com/saphelp_bw33/helpdata/en/f1/0a5a2ee09411d2acb90000e829fbfe/frameset.htm -> Business Explorer ->
    Web Application ... -> Befehl URLs
    Concat the date in JavaScript and call
    SAPBWOpenURL(SAP_BW_URL_Get()+'&item=...&FILTER_IOBJNM="0FISCPER"&FILTER_VALUE="TheDateYouWant"') (I hope I set the " and ' correctly, better you should check).
    For example you can insert :
    <HEAD>
    <script>
        function callTheTableWithTheDate()
            SAPBWOpenURL(like above);
    </script>
    </HEAD>
    <BODY onload="JavaScript:callTheTableWithTheDate()">
    It's only a hint, adjust it for your requirements. You can save the date in a cookie too and reuse it whenever you want. You know how to handle cookies ?
        Bye
        Ralf

  • Get max value with other fields

    Hi All,
    I have a table as below
    Name Value
    A1     5
    A3 10
    A2 7
    A2 9
    A1 10
    What I would like to get is the max(Value) and with grouping of its name
    Name     Value
    A2 16
    Thanks
    Alex
    Edited by: user8606416 on 01-Jun-2011 10:17
    Edited by: user8606416 on 01-Jun-2011 10:26

    Depending on how you feel about ties one of:
    SELECT name, value
    FROM (SELECT name, SUM(value)
          FROM table
          GROUP BY name
          ORDER BY 2 DESC)
    WHERE rownum = 1
    SELECT name, SUM(value)
    FROM table
    GROUP BY name
    HAVING SUM(value) >= ALL (SELECT SUM(value)
                              FROM table
                              GROUP BY name)among many other methods. The first will pick a single arbitrary record in case of a tie, the seond will show all of the tied records.
    John

  • Retaining BSP Page values with Javascript popup window

    Hi Experts
    We are using a customized BSP application for our performance
    Management. To propmt users for saving their appraisal documents
    before a session timeout,we used an Javascript popup message(alert
    window). This window doesnot affect the BSP page in any way.(code
    provided below)
    Per changed requirement,we now have to retain the BSP page values once
    the user clicks 'OK' on this javascript popup window. I used the page
    refresh option with script. But this is erasing the earlier values.
    Can anyone tell me,how i can holdback the BSP page values after the
    user action on the popup window. If a piece of code is provided,it
    would be greatly appreciated.
    Thanks in Advance
    Alan
    Existing code for timeout popup
    javascript code
    function remind (){
    var msg = "Your Session will expire in the next 10 minutes. Please
    save your data.";
    alert the msg(using alert box)
    <%
    data: v_rem type string.
    DATA: port TYPE STRING.
    data: l_timer type string.
    port = request->get_header_field(
    if_http_header_fields_sap=>server_port ).
    DATA: services TYPE TABLE OF ICM_SINFO.
    CALL FUNCTION 'ICM_GET_INFO' TABLES SERVLIST = services.
    FIELD-SYMBOLS: <service> TYPE ICM_SINFO.
    DATA: wait TYPE STRING.
    READ TABLE services ASSIGNING <service> WITH KEY service = port.
    wait = <service>-KEEPALIVE - 10.
    CONDENSE wait.
    ****Start Changes: Timeout
    **l_timer = wait * 60 * 1000.
    l_timer = 1 * 60 * 1000.
    ****End Changes
    concatenate `'remind(` wait `)',` l_timer into v_rem.
    %>
    <htmlb:content design            = "DESIGN2002+DESIGN2003"
                   sessionManagement = "TRUE"
                   controlRendering = "SAP">
    <htmlb:page title = "<%= otr(ZPMDGL/TITLE_DOCUMENT) %>"
                  disableBackspaceNavigation = "TRUE" onLoad pass v_rem as a  parameter to setTimeout
    Edited by: Bala Subramanyam Duvvuri on Apr 8, 2008 6:32 AM
    Edited by: Bala Subramanyam Duvvuri on Apr 8, 2008 6:34 AM
    Edited by: Bala Subramanyam Duvvuri on Apr 8, 2008 6:35 AM
    Edited by: Bala Subramanyam Duvvuri on Apr 8, 2008 6:36 AM
    Edited by: Bala Subramanyam Duvvuri on Apr 8, 2008 6:36 AM
    Edited by: Bala Subramanyam Duvvuri on Apr 8, 2008 6:37 AM
    Edited by: Bala Subramanyam Duvvuri on Apr 8, 2008 6:38 AM
    Edited by: Bala Subramanyam Duvvuri on Apr 8, 2008 6:39 AM
    Edited by: Bala Subramanyam Duvvuri on Apr 8, 2008 6:40 AM
    Edited by: Bala Subramanyam Duvvuri on Apr 8, 2008 6:40 AM
    Edited by: Bala Subramanyam Duvvuri on Apr 8, 2008 6:44 AM
    Edited by: Bala Subramanyam Duvvuri on Apr 8, 2008 6:46 AM

    If the BSP page is refrehed, all the user input it sent back to the server. If you don't do anything special, the input is lost and not sent back to the client again. You can go to your controller class' DO_HANDLE_DATA to read the user input, and store it in the controller class to send it back to the client.
    If you don't use controller classes, the equivalent would be onInputProcessing. A more advanced alternative would be to use MVC model binding, which would do most of the stuff automatically for you.

  • Verify if a report has a null column value with JavaScript ?

    Hi,
    I have report. User can add new rows through a form. Before the user leaves the application I would like to use JavaScript to check if a certain column has some null values. I built my JavaScript for the before logout and it's working properly, but I need to retrieve if that column has some null values, how can I do that ? This field isn't a mandatory one, but I would just like to alert the user.
    Thank you.

    You can also use a TRIM function in Answers. Go to the column in question, click on the fx button and then on the Function button. Click on String and you will see TrimLeading, TrimTrailing and TrimBoth. Use TrimTrailing on your column and you should be good to go.

  • I get a box with "javascript:;" in bottom left corner when I hover over a pulldown menu in eBay both in Firefox and IE. Help!

    It is happening on both of my computers, laptop and desktop. This is a Windows 7 machine. It was working fine yesterday. Nothing has changed. I called eBay and they couldn't figure it out either!

    I assume this may be a issue with eBay's code. Can you try to clear the cache and cookies?
    Many site issues can be caused by corrupt cookies or cache. In order to try to fix these problems, the first step is to clear both cookies and the cache.
    Note: ''This will temporarily log you out of all sites you're logged in to.''
    To clear cache and cookies do the following:
    #Go to Firefox > History > Clear recent history or (if no Firefox button is shown) go to Tools > Clear recent history.
    #Under "Time range to clear", select "Everything".
    #Now, click the arrow next to Details to toggle the Details list active.
    #From the details list, check ''Cache'' and ''Cookies'' and uncheck everything else.
    #Now click the ''Clear now'' button.
    Further information can be found in the [[Clear your cache, history and other personal information in Firefox]] article.

  • Please help with javascript problem

    Hi
    I'm trying to get 4 images to rotate(image1.jpg, image2.jpg,
    image3.jpg and image4.jpg). However, only image1.jpg is loading up.
    In the head, my code is:
    <script language="JavaScript1.1">
    <!--
    var image1=new Image()
    image1.src="image1.jpg"
    var image2=new Image()
    image2.src="image2.jpg"
    var image3=new Image()
    image3.src="image3.jpg"
    var image4=new Image()
    image4.src="image4.jpg"
    //-->
    </script>
    In the body my code is:
    <div id="content">
    <div class="feature"><img src="image1.jpg"
    alt="Photos" name="rotating" width="150" height="175" id="rotating"
    />
    <script>
    <!--
    //variable that will increment through the images
    var step=1
    function slideit(){
    //if browser does not support the image object, exit.
    if (!document.images)
    return
    document.images.slide.src=eval("image"+step+".src")
    if (step<3)
    step++
    else
    step=1
    //call function "slideit()" every 2.5 seconds
    setTimeout("slideit()",2500)
    slideit()
    //-->
    </script>
    Only image1 loads up. I would really appreciate if someone
    could tell me which lines need to change and to what. Also, how can
    I smooth down the change (i.e. rather than have images change
    suddenyl). Thanks in advance. Mike

    http://www.mickweb.com/javascript/rotate/sequentialRotate.html
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title>Rotate</title>
    <meta http-equiv="Content-Type" content="text/html;
    charset=ISO-8859-1">
    <script type="text/javascript">
    function r(){
    var imgs=
    ["lee.jpg","joe.jpg","rhiannon.jpg","gary.jpg","caroline.jpg","ann.jpg"],
    s=imgs[new Date().getTime()%imgs.length];
    document.main.src=s;
    document.getElementById("foo").innerHTML=s+"<BR>";
    t=setTimeout("r()",2500)
    </script>
    </head>
    <body onLoad="r()">
    <img src="../transparent.gif" name="main" id="main">
    <p>
    <span id="foo"></span></p>
    </body>
    </html>
    You need only to populate "imgs" array:
    var imgs=
    ["image1.jpg","image2.jpg","image3.jpg","image4.jpg"]
    And to include a place holder for the images, named "main":
    <img src="transparent.gif" name="main" id="main">
    If you don't have a transparent gif. use the first image in
    the array:
    <img src="image1.jpg" name="main" id="main">
    Mick
    Mike93510 wrote:
    > Hi
    >
    > I'm trying to get 4 images to rotate(image1.jpg,
    image2.jpg, image3.jpg and
    > image4.jpg). However, only image1.jpg is loading up.
    >
    > In the head, my code is:
    > <script language="JavaScript1.1">
    > <!--
    > var image1=new Image()
    > image1.src="image1.jpg"
    > var image2=new Image()
    > image2.src="image2.jpg"
    > var image3=new Image()
    > image3.src="image3.jpg"
    > var image4=new Image()
    > image4.src="image4.jpg"
    > //-->
    > </script>
    >
    > In the body my code is:
    > <div id="content">
    > <div class="feature"><img src="image1.jpg"
    alt="Photos" name="rotating"
    > width="150" height="175" id="rotating" />
    > <script>
    > <!--
    > //variable that will increment through the images
    > var step=1
    > function slideit(){
    > //if browser does not support the image object, exit.
    > if (!document.images)
    > return
    > document.images.slide.src=eval("image"+step+".src")
    > if (step<3)
    > step++
    > else
    > step=1
    > //call function "slideit()" every 2.5 seconds
    > setTimeout("slideit()",2500)
    > }
    > slideit()
    > //-->
    > </script>
    >
    >
    > Only image1 loads up. I would really appreciate if
    someone could tell me which
    > lines need to change and to what. Also, how can I smooth
    down the change (i.e.
    > rather than have images change suddenyl). Thanks in
    advance. Mike
    >

Maybe you are looking for