Passing javascript value to jsp param

Hi all,
I want to be able to pass the return value of function getUrl() to jsp param...Is this a correct way? it's not working.... What should I assign to the value of param?
<HTML>
<HEAD>
</HEAD>
<script language="javascript">
function getUrl()
     var url=window.location;
     return url;
</script>
<BODY>
<jsp:include page='GetFileServlet' flush="true" >
<jsp:param name="url" value= "return getUrl()"/>
</jsp:include>
</BODY>
</HTML>
thank you for your time and assistance

Hi all,
I want to be able to pass the return value of
function getUrl() to jsp param...Is this a correct
way? it's not working.... What should I assign to
the value of param?
<HTML>
<HEAD>
</HEAD>
<script language="javascript">
function getUrl()
     var url=window.location;
     return url;
</script>
<BODY>
<jsp:include page='GetFileServlet' flush="true" >
<jsp:param name="url" value= "return getUrl()"/>
</jsp:include>
</BODY>
</HTML>
thank you for your time and assistanceThis can't be done, since the jsp call will be exercised on the server, before the page gets sent to the user, while the javascript gets performed on the client (well after the jsp is done its job).
An all server-side solution would be what you needed:
<HTML>
    <HEAD>
    </HEAD>
    <BODY>
        <jsp:include page='GetFileServlet' flush="true" >
            <jsp:param name="url" value= "<%=request.getRequestURL()%>"/>
        </jsp:include>
    </BODY>
</HTML>

Similar Messages

  • Passing JavaScript value to Jsp

    Hi,
    Any idea how to pass a value from javascript to jsp page when the page gets load on browser.
    I use below code but an event is require to pass the value. Is there any code that pass automatically the value from javascript to jsp.
    <html>
    <head>
    <title>Passing Javascript value to Jsp</title>
    <script type="text/javascript" language="javascript">
    var scriptVar = "Noy"
    var WinNetwork = new ActiveXObject("WScript.Network")
    document.write (WinNetwork.username)
    document.index.hiddenTextBox.value = WinNetwork.username
    </script>
    </head>
    <%
    String jspVar = null;
    if(request.getParameter("submit") != null){
         jspVar = request.getParameter("hiddenTextBox");
         out.println("Jsp Var : " + jspVar);
    %>
    <body>
    <form name="index" onSubmit="index.jsp" method="post">
    <input type="hidden" name="hiddenTextBox"><br>
    <input type="submit" name="submit" value="Submit">
    </form>
    </body>
    </html>
    Thanks,
    ~ukbasak

    JSP/Java runs at the server side, produces a HTML page, sends it to the client side and then stops running.
    HTML, containing under each CSS and JS, arrives at the client side and runs at the client side only.
    To invoke JSP/Java using HTML you need to fire a request to the server side. That can be either a plain vanilla <a> link, a <form> to be submitted or an asynchronous Ajaxical request.
    That said, the use of ActiveX in web applications is discouraged. It's a Microsoft IE proprietaty. With other words, it isn't and won't be supported by all alternative browsers which the other half of the world is using.

  • Passing JavaScript values to JSP variables

    Can any body correct the follwing code
    <Script language="JavaScript">
    function test( x )
    <%
    int num = x;
    num = num * 2;
    %>
    v.value = "<%out.print(num);%>";
    <input type="button" name="b" value="test" onClick="test(5)">
    <input type="text" name="v" value="0">
    In short, I am trying to pass JavaScript value to JSP variable. I hope that it is possible to do that. If it is possible then how can I do it. I want to assing the variable x passed to the JavaScript function called test to the JSP variable called num.
    Regards,
    Ageel

    Thank you for your reply,,,
    I think then the only way to do it is to post the
    value on the server and then use request.getParameter
    method in jsp code
    but the question now how can I post values to the
    server using JavaScript without reloading the pageyes... you can to it by create a new popup window which will submit the value to server after page was loaded... then, server return a value to the same window in html/jsp page which then using javascript to set it back to the opener and close up the window... however, this is not a good choice unless you have no other alternative...
    >
    There is other possible solution
    if I can get the text field value from the same page
    without reloading it that would work fine and will
    solve my problem, is it possible?yes... you can get the value from the textfield...
    for example :
    function showValueInTextField()
        alert(document.forms[0].elements["mytextfieldname"].value);
    >
    My final question> can jsp change things on the same
    page without reloading it. I mean can it work like
    JavaScript so that I can use it's internal functions
    instead of using java script :S
    not really know what you trying to say here...

  • Passing javascript values to jsp without refreshing the page

    Hi,
    How do u pass a value of a javascript variable to the jsp without refreshing the page ?
    For example, a file called test.jsp in which a javascript variable x contains value 254. I need to pass the value of x to a method declared in test.jsp(same page).

    Hi Mona,
    when i say refresh i do mean a blink of the browser.
    This is a small example i wrote to show you how you can pass javascript varables to JSP variables. If you don't want the refresh to be seen by the user just include this code in a hidden frame on a page and instead of refreshing the entire page, refresh the hidden frame.
    i have to say, i didn't test the code so i don't guarantee it's flawless.
    if you need an more detailed example just tell me, i'll create one, but it won't be for today :)
    <html>
    <head>
         <title>Log in to the system</title>
    </head>
    <body>
    <script>
    //we retrieve the parameter 'user' from the URL
    <%
      String username = request.getParameter("user");
    %>
    var user = "<%= username%>";
    //check if there is a username in the URL
    if(user=="null")
      //there is no username so we log the person in as a guest
      user="guest";
      //we refresh the page and set the user parameter to 'guest'
      //the parameter now contains the javascript variable 'user'.
      //The parameter can be read by the JSP (see the top op this script).
      //This way we gave the javascript variabele to the JSP variable
      location="login.jsp?user="+user;
    else if(user=="guest")
    {  alert("Welcome "+user+", I hope you like this site"); }
    else
    {  alert("Welcome "+user+", I'm glad to see you again"); }
    </script>
    </body>
    </html>

  • Passing Javascript values to JSP

    Hi,
    I have a select box and i get the selected value using the javascript. The variable that stores the value should be passed to the JSP. I need to know , how i an do the same.
    When a user clicks on a option I call a javascript function:
    function myFun()
    var text = document.myform.selectboxname.options[index].text;
    return text;
    I need to get the value returned.
    The select option is as follows.
    <select name="sel" multiple onChange=myFun()>
    How can i get the value "text".
    Kindly help.

    if yes.....my functions returns a value...how can i
    access the same.You can't, in the way you want it. You need the function to put the value where it's supposed to go.
    I'm sorry, but this question is clearly out of scope for this board. Look for a Javascript support forum. Just the fact that the HTML originated from a JSP doesn't make it a Java question.

  • How to pass JavaScript value to JSP variable

    I know this is not possible. But I need to do this :
    <script language = "Javascript">
    function findElement() {
    for(i=0; i<document.forms[0].elements.length; i++){
    if(document.forms[0].elements.type == 'text') {
    var elName = document.forms[0].elements.name;
    var elValue = document.forms[0].elements.value;
    // Display element name and value
    //alert(elName +' = '+ elValue)
    <%
    String elName = elName;
    System.setProperty(%>elName<%, %>elValue<%);
    %>
    </script>
    in JSP. I need to get the name and value of the textbox in the form to just change one property on the JSP System. Any help pls

    Thanks man, I think that would work.
    I found something else already though and it works on the same page
    <%
         Enumeration parameters = request.getParameterNames();
         String parameterValue = " ";
         String parameterName = " ";
                   while (parameters.hasMoreElements()) {
                        parameterName = (String) parameters.nextElement();
                        parameterValue = request.getParameter(parameterName);
                   out.println("NAME =========" + parameterName);
                   out.println("VALUE =========" + parameterValue);
                   //System.setProperty(parameterName, parameterValue);
         %>
    Thanks again for the help

  • How to pass javascript variable to jsp function

    i want to check which table header (that is <th> in html )is clicked and based on that a jsp funtion do a query in database and should show records in sorted way according to which column head is clicked.
    Table is created in html.
    My function is
    Vector varray = workcaseid.getWorkcaseId(Long.parseLong(MasterAccountNumber),SelectedColumn);
    <table border="1">
              <th ><label onClick="<%SelectedColumn="workcase_id";%>">Workcase Id</label></th>
              <th><label onClick="<%SelectedColumn="status_id";%>">Status</label></th>
    <tr><td>etc</td></tr>
    </table>

    im using bean for business login, following mvc model,and i think mvc is one of good design practice to use.
    <jsp:useBean id="workcaseid" scope="session"class="beanFiles.SearchWorkcaseId" />
    varray = workcaseid.getWorkcaseId(Long.parseLong(MasterAccountNumber),SelectedColumn);
    just tell me whether it is possible to pass javascript variable to jsp variable or not.i can do it by using hidden input type,using form and submit button.

  • Using a variable as a value in jsp:param

    I was wondering, I have a String variable, vid_1, and want to use a jsp:include and pass that in as one of the parameters. How can I do this? I have to do some testing to make sure vid_1 is valid and set a default if not. It contains a number referring to which video needs to be displayed.
    Is there anyway I can get this value to be used in jsp:param value?
    John

    RahulSharna wrote:
    Well,First thing you haven't pharsed your question properly.
    Anyways as per my understading.
    The first thing is make use of in this case as your defined requirement states you need to make use of variables of both the JSP's which need compile time include not at the runtime.use of
    <%@ include file="url" %>would be more appropriate as you want to use the variable of parent jsp to the child one.
    Anyways if you are thinking to apply a solution using <jsp:include/>
    <jsp:include page="url">
    <jsp:param name="paramName" value="<%=stringVariable>"/>
    </jsp:include>and extract the paramName's corresponding value as a request parameter in other JSP.
    Hope that might answer your question :)
    REGARDS,
    RaHuLRaHul,
    Thanks for the reply. The second example you gave is what I was trying to do. I thought I did exactly what you have there and it was not working. I will check it over again and post back on here when I have a chance.
    For now I was trying to use c:set to save the variable in the request and then using the EL expression ${requestScope.variable} to put it in the <jsp:param> element. I had some things working and others not when I quit. Hopefully tomorrow I can give you a full report and we can get this worked out.
    Maybe my problem is something else? Look at this post of mine:
    http://forum.java.sun.com/thread.jspa?threadID=5236252&tstart=10
    Thanks so much for the help.
    John

  • Need a fast answer... passing javascript variable to jsp page (how to use)

    This test application has 3 frames.
    I'm assigning a value "stuff" to a variable ("testfield1") in a javascript function ("getTest") that exists inside an html frame (testpage1.html)
    Then, I click on the "test submit" hypertext link to pass the value of "testfield1" to the JSP frame (testpage2.jsp) by invoking a function ("getData") in "testpage2".
    In function ("getData"), I am passing the variable "testfield1" as a parameter to the "getData" function in "testpage2".
    In "testpage2" - in the ("getData" function) I try to assign the value of the variable "testfield1" to another variable called "testfld1".
    Then, I try to extract the value of "testfld1" into a variable called "tstfld1" in a JSP scriptlet
    ....I.E. [ String tstfld1  = request.getParameter("testfld1");  ]
    But, the value is apparently not passed successfully, as tstfield1 appears to be "null".
    Can anyone explain what I'm doing incorrectly?
    The code for this test app is below...
    ********testpage0 - the parent frame*********
    <HTML>
    <HEAD>
    <TITLE>GlobalView Reports and Trending Menubar</TITLE>
    </HEAD>
    <FRAMESET FRAMEBORDER="0" ROWS="15%,85%">
    <FRAME SRC="testpage0.html" NAME="testhtmlparent">
    <FRAMESET FRAMEBORDER="0" COLS="23%,77%">
    <FRAME SRC="testpage1.html" NAME="testhtml">
    <FRAME SRC="testpage2.jsp" NAME="testjsp">
    </FRAMESET>
    </FRAMESET>
    </HTML>
    *******testpage1.html********
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <html>
         <head><title>testpage1</title>
         <link rel="stylesheet" type="text/css" href="./standard.css">
              <script LANGUAGE="JavaScript">
              parent.frames[2].location = "blank.html";
              function getTest(reportType)
                   testfield1 = "stuff";
                   alert("testpage1.html...testfield1=" + testfield1 + ", reportType=" + reportType);
                   parent.frames[2].location = "testpage2.jsp";
                   parent.frames[2].getData(testfield1);
                   return;
              </script>
         </head>
         <body bgcolor="#FFFFFF" text="#000000">
              <form name="reportRange">
                   <center>
                        <fieldset style="padding: 0.5em" name="customer_box">
                        <table cellpadding="0" cellspacing="0" border="0">
                             <tr class="drophead">
                                  <td valign="top" height="0" ><span class="drophead">
                                       test submit
                                  </td>
                             </tr>
                        </table>
                        </fieldset>
                   </center>
              </form>
         </body>
    </html>
    *******testpage2.jsp*********
    <%@ page language="java" import="java.io.*, java.util.*" errorPage="error.jsp" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <html>
         <head>
         <title>testpage2</title>
         <script language="JavaScript">
              function getData(testfield1)
                   alert("testpage2.jsp...testfield1=" + testfield1);
                   document.pageData.testfld1.value = testfield1;
                   document.pageData.submit();
         </script>
         </head>
         <body>
              <%
                   String error;
              %>
              <div id="HiddenForm">
                   <form name="pageData" method="post" action="testpage2.jsp" target="_self">
                   <input type="hidden" name="testfld1" value="0">
              </form>
              </div>
              <%
                   String tstfld1 = request.getParameter("testfld1");
              %>
              <P> testfld1 = <%= tstfld1 %> </P>
         </body>
    </html>

    parent.frames[2].getData(testfield1); is in testpage1.html
    so in the document.pageData.testfld1.value = testfield1; document = testpage1.html( not testpage2.html)
    modifying the getData to accept the document object, and refering this object to parent.frames[2].document may help you.
    good Luck ....

  • How to pass the value from JSP or HTML  to Applet

    Plz reply ....How can we pass the value from the JSP Page or from HTML page to Applet embedded in same page....

    Hi,
    <applet codebase = "."
    archive = foo.jar"
    code = "com.bar"
    name = "bar"
    id = "bar"
    width = "<%=Request["width"] %>"
    HEIGHT = "<%=Request["appHeight"] %>"
    hspace = "0"
    vspace = "0"
    align = "middle"
    alt     = "Applet is Loading..."
    >
         <param name="LANGUAGE"                value="<%=Request["lan"] %>">          
         <param name="LOGOUT_USER_URL"           value="EndSession.asp">
         <param name="DATA_READ_INTERVAL"      value="10000">
         <param name="REFRESH_INTERVAL"           value="5000">     
         <param name="DEFAULT_FONT"           value="Arial">
    </applet>
    pass values @ ur html or jsp page to Applet as parameters.
    Refer above code. By using getParameter() method of Applet, u can take values inside applet.

  • How To Pass the value from JSP to Applet

    plz reply how can we pass the value from the JSP to Applet ...the applet is embedded in JSP page....

    Hi,
    <applet codebase = "."
    archive = foo.jar"
    code = "com.bar"
    name = "bar"
    id = "bar"
    width = "<%=Request["width"] %>"
    HEIGHT = "<%=Request["appHeight"] %>"
    hspace = "0"
    vspace = "0"
    align = "middle"
    alt     = "Applet is Loading..."
    >
         <param name="LANGUAGE"                value="<%=Request["lan"] %>">          
         <param name="LOGOUT_USER_URL"           value="EndSession.asp">
         <param name="DATA_READ_INTERVAL"      value="10000">
         <param name="REFRESH_INTERVAL"           value="5000">     
         <param name="DEFAULT_FONT"           value="Arial">
    </applet>
    pass values @ ur html or jsp page to Applet as parameters.
    Refer above code. By using getParameter() method of Applet, u can take values inside applet.

  • How to pass an Array to jsp:param

              Hi,
              I am trying to find out how to pass an array to a jsp:param tag abnd then retrieve
              the values in the next page. Please help soon. Thanks
              Here's my code - Assume the books array has more than 1 value
              String[] books = request.getParameterValues("book");
              <jsp:include page="<%=contentPage%>" flush="true">
              <jsp:param name="bookSelected" value="<%= books %>" />
              </jsp:include>
              The 'contentPage' takes me to the next page where I have the following to retrieve
              the value of 'bookSelected'
              String[] bookSelected = request.getParameter("bookSelected");
              I tried accessing the array like this
              if(bookSelected.equals("book1"))
              but did not succeed.
              I tried accessing the array in a loop but it did not work. Here's what I tried.
              <jsp:include page="<%=contentPage%>" flush="true">
              <%for (int i = 0; i<books.length; i++){
              %>
              <jsp:param name="bookSelected" value="<%= books %>" />
              <% } %>
              </jsp:include>
              

    Hi
    tell me how you redirect from __confirmdelete.jsp:__ to deleteServlet.java..
    and post detail code of __confirmdelete.jsp:__

  • Assign Javascript Value to JSP

    I have a dynamic link that links to a Javascript function:
    test
    The javascript function:
    function frames(testing)
    <%=testHere%> = testing
    <%
    HttpSession testSession = request.getSession(true);
    testSession.putValue("tested", testHere);
    %>
    I want to assign the javascript value, testing, into JSP value,testHere, which will be place in the session, which is :~
    .......putValue("tested", testHere).
    Does anyone know how to solve it? =)
    Thanks in advance...

    You can't. As is stated here about 3 times a day, Java, the JSP code, and servlets run on the Server, while javascript runs on the client (in the browser). By the time javascript begins to run, the JSP is compiled, run, the response generated and sent to the browser as HTML.
    The only means to do this is to send the variable back to the browser by requesting the same or another page and including the javascript value as a parameter to that page.

  • Passing parameter values to jsp

    hi i have got a slight probelm that my jsp doesnt print out teh value that is being to it from teh wml
    my wml file is:
    <b><big> Subject:</big></b>
                             <input type ="text" name="srch" height="20" format="*X,*x"/>
                             <do type="accept" label="Search">
                             <go href="http://localhost:8080/srch2.jsp" method="post">
                             <postfield name="Subject" value="$srch"/>
    jsp:
    <?xml version="1.0" encoding="utf-8"?>
         <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN"
              "http://www.wapforum.org/DTD/wml13.dtd">
    <%@ page language="java" contentType="text/vnd.wap.wml"%>
    <wml>
    <card id="srch" title="Search">
         <p>
              <%
                   String Search;
                   Search=(String)request.getParameter("srch");
                   out.println("<br/>Search is"+Search);
              %>
              </p>
         </card>
    the reulst i get is Search isnull, where is the probelm?
    thank you very much

    hi thanks for replying
    my form is here:
    <?xml version="1.0" encoding="utf-8"?>
         <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN"
              "http://www.wapforum.org/DTD/wml13.dtd">
    <wml>
         <card id="search" title="Search">
                   <p align="left">
                        <fieldset title="subject">
                             <b><big> Subject:</big></b>
                             <input type ="text" name="srch" height="20" format="*X,*x"/>
                             <do type="accept" label="Search">
                             <go href="http://localhost:8080/srch2.jsp" method="post">
                             <postfield name="Subject" value="$srch"/>
                             </go>
                             </do>
                        </fieldset>     
                   </p>
         </card>
    </wml>
    would you be bale to tell what is worng anfd why it doesnt print?
    thank you

  • Passing Multiple values from jsp to servlet

    Dear all,
    I am trying to do a very simple thing. I need to pass names of all products that have been added to the cart.
    Below is my jsp. Basically I am trying to make something very basic using ajax, and later actually build it.
    heres my code with 2 questions... all I need to do is to pass the names of the products.
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <HTML>
    <HEAD>
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
         pageEncoding="ISO-8859-1"%>
    <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <META name="GENERATOR" content="IBM Software Development Platform">
    <TITLE>ShowCart.jsp</TITLE>
    </HEAD>
    <script>
    xhr = null
    var flag = false;
    var amount = 0;
    function getData(url,divid,prodName){
              var as = "added"+divid // this is the divid
              if (document.getElementById(as)!=null)
                   document.getElementById(as).innerHTML ="adding"
           if (window.XMLHttpRequest){
             xhr=new XMLHttpRequest()
           else if (window.ActiveXObject){
             xhr=new ActiveXObject("Microsoft.XMLHTTP")
           if (xhr){
              xhr.onreadystatechange=callback       
             xhr.open("GET",url,true)
             xhr.send(null)
             setDivid(as);
             updateCart(divid,prodName);
           else{
             alert("XMLHTTP not supported")
    function setDivid(as){
    if(flag){
         document.getElementById(as     ).style.backgroundColor = "RED";
            document.getElementById(as).innerHTML = "item added";
    function updateCart(divid,prodName){
    amount += divid;
    document.getElementById("amount").innerHTML = "price is "+amount;
    udpateSubmitData(prodName);
    function updateSubmitData(prodName){
    var = document.getElementById("Hidden"+prodName).value;
    //do I need to do something here to submit the data ? ------------------1
    function callback(dd){
           // when finished
           if (xhr.readyState==4){
                  //  OK
                  if (xhr.status==200){
                 // process the result.
                  flag = true;
           else{
                  alert("error")
    </script>
    <BODY>
    <P>Place content here.</P>
    The products are :
    <%
    if(request.getAttribute("Products")!= null){
    java.util.ArrayList list = new java.util.ArrayList();
    list = (java.util.ArrayList)request.getAttribute("Products");
    for(int i=0; i<list.size(); i++){
    com.deere.sc.bean.ProductBean pb1 = new com.deere.sc.bean.ProductBean();
    pb1 = (com.deere.sc.bean.ProductBean)list.get(i);;
    %>
    <table>
    <td>
    <% out.println(pb1.getProductName());
         out.println(pb1.getProductPrice());
         %> <td> <div id="added<%= i %>"> </div> </td>
    <td>     <a href = "javaScript:getData('/SC/AddToCart?name=<%= pb1.getProductName() %>',<%= i %>,<%= pb1.getProductName() %>);"> add to cart</a>  </td>
         <input type="hidden" id="Hidden<%= pb1.getProductName() %>" value ="<%= pb1.getProductName() %>">
         </td>
         <%
    }//end for
    }//end if
    %>
    </table>
    Thank you for shopping at the looters .. heh ;)
    Total amount of money in your cart is <div id ="amount"> </div>
         <a href = "/SC/CheckOut">Check out cart</a>
    <!-- OR may be just add Hidden tags here ?  ______________________2 -->
    </BODY>
    </HTML>Any help on tips for proceeding from here will be helpful.
    thanks in advance

    Dear all,
    I am trying to do a very simple thing. I need to pass names of all products that have been added to the cart.
    Below is my jsp. Basically I am trying to make something very basic using ajax, and later actually build it.
    heres my code with 2 questions... all I need to do is to pass the names of the products.
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <HTML>
    <HEAD>
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
         pageEncoding="ISO-8859-1"%>
    <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <META name="GENERATOR" content="IBM Software Development Platform">
    <TITLE>ShowCart.jsp</TITLE>
    </HEAD>
    <script>
    xhr = null
    var flag = false;
    var amount = 0;
    function getData(url,divid,prodName){
              var as = "added"+divid // this is the divid
              if (document.getElementById(as)!=null)
                   document.getElementById(as).innerHTML ="adding"
           if (window.XMLHttpRequest){
             xhr=new XMLHttpRequest()
           else if (window.ActiveXObject){
             xhr=new ActiveXObject("Microsoft.XMLHTTP")
           if (xhr){
              xhr.onreadystatechange=callback       
             xhr.open("GET",url,true)
             xhr.send(null)
             setDivid(as);
             updateCart(divid,prodName);
           else{
             alert("XMLHTTP not supported")
    function setDivid(as){
    if(flag){
         document.getElementById(as     ).style.backgroundColor = "RED";
            document.getElementById(as).innerHTML = "item added";
    function updateCart(divid,prodName){
    amount += divid;
    document.getElementById("amount").innerHTML = "price is "+amount;
    udpateSubmitData(prodName);
    function updateSubmitData(prodName){
    var = document.getElementById("Hidden"+prodName).value;
    //do I need to do something here to submit the data ? ------------------1
    function callback(dd){
           // when finished
           if (xhr.readyState==4){
                  //  OK
                  if (xhr.status==200){
                 // process the result.
                  flag = true;
           else{
                  alert("error")
    </script>
    <BODY>
    <P>Place content here.</P>
    The products are :
    <%
    if(request.getAttribute("Products")!= null){
    java.util.ArrayList list = new java.util.ArrayList();
    list = (java.util.ArrayList)request.getAttribute("Products");
    for(int i=0; i<list.size(); i++){
    com.deere.sc.bean.ProductBean pb1 = new com.deere.sc.bean.ProductBean();
    pb1 = (com.deere.sc.bean.ProductBean)list.get(i);;
    %>
    <table>
    <td>
    <% out.println(pb1.getProductName());
         out.println(pb1.getProductPrice());
         %> <td> <div id="added<%= i %>"> </div> </td>
    <td>     <a href = "javaScript:getData('/SC/AddToCart?name=<%= pb1.getProductName() %>',<%= i %>,<%= pb1.getProductName() %>);"> add to cart</a>  </td>
         <input type="hidden" id="Hidden<%= pb1.getProductName() %>" value ="<%= pb1.getProductName() %>">
         </td>
         <%
    }//end for
    }//end if
    %>
    </table>
    Thank you for shopping at the looters .. heh ;)
    Total amount of money in your cart is <div id ="amount"> </div>
         <a href = "/SC/CheckOut">Check out cart</a>
    <!-- OR may be just add Hidden tags here ?  ______________________2 -->
    </BODY>
    </HTML>Any help on tips for proceeding from here will be helpful.
    thanks in advance

Maybe you are looking for

  • HT2376 Trying to install scrapbook software but wont install due to quicktime

    I recently tried to install Software Scrapbook Boutique on my MAC Pro OS X Version 10.7.4 and all the files wont install without Quicktime. I have Quicktime Version 10.1, and it won't work.  I am administrater, I recently bought my laptop from a frie

  • Converting data through mapping table

    Member names of account dimension in our Essbase will be changed totally.In Excel we have a mapping table which tells how new accounts corresponds to old accounts. Number of accounts is about 800.How this conversion procedure should technically be do

  • How to create webcontent

    I have application running in liferay . here we create the pages based on xml structure. like xml contain Report group reportname month date expiry mode reportname reportgroup when we create the page ,we follow the default structure and keep on repea

  • Cant open Illustrator CS6

    Have a PC windows 7 been using Illustrator CS6 no problems...now can't open.  Get a pop up window with a big red X   "The operation cannot complete because of an unknown error.  Do I need to reload ?

  • Live Streaming video to HTML 5

    Hi, I want to know that whether it is possible to to live stream video in HTML5 from adobe media server or not.I have already gone through this link http://tv.adobe.com/watch/max-2011-develop/streaming-video-to-html5-apple-and-flash-enable d-devices/