Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8652123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:14:08+00:00 2026-06-12T14:14:08+00:00

I am trying to pass value from one JSP page to another page using

  • 0

I am trying to pass value from one JSP page to another page using jquery.In below code I would like to pass the variable “processId” to another page. The value should pass to another page after the below JSP page is loaded.

I am getting error: “procId is undefined”

<head>
<script type="text/javascript" src="jqwidgets/scripts/jquery-1.8.1.min.js"></script>

<script type="text/javascript">
window.onload=passValue;
function passValue()
{
$.post("Testing.jsp", {processId: ""+procId+""});
}
</script>
</head>
<%
String processId = "555";
%>
<form name="fm" id="fm">
<input  type="hidden" id="procId" value="<%=processId%>" name="processId">
</form>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T14:14:09+00:00Added an answer on June 12, 2026 at 2:14 pm

    jQuery calls should be placed within the standard block:

    $(document).ready(function(){
        //jQuery code here
    });
    

    With this block, the code won’t execute until the DOM is fully loaded; you don’t need to assign a function to window.onload. 

    Next, to grab the value of the input with id “procId”, you need to create a jQuery object using the regular syntax: $('#procId'), then access its value with .val()

    So this should do it:

    $(document).ready(function () {
        $.post("Testing.jsp", {"processId": $("#procId").val() })
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to pass a session variable from one page to another using
I am trying to pass a variable from one page, load another and enter
I am using this code. Trying to pass form values from one internal page
I am trying to pass a selected checkbox value from one page to another
I have been trying to pass a string value from one method into another.
I have this code. Trying to pass form values from one internal page to
I'm trying to pass a variable from one function to another, but the var
I am trying to pass a value from one tab to another. I tried
Hi I am trying to pass a value from one file to another file
I am trying to pass an object from one page to another page where

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.