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

  • SEARCH
  • Home
  • 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 9035143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T08:41:08+00:00 2026-06-16T08:41:08+00:00

I am developing a web application using JSP and Servlet. I am trying to

  • 0

I am developing a web application using JSP and Servlet.

I am trying to call javascript function on the click event of hyperlink, and with that I am also passing some parameters to servlet using query string.

<td> <a href="#?id=<%=data[i][0]%>&protID=<%=data[i][1]%>&seqNo=<%=data[i][2]%>" onclick="getValues();" >Edit</a></td>

javascript function:

<script>
function getValues()
{
    var url = document.URL;
    var planID = url.split("=");
    var pID = planID[1].split("&");

    var remURI = url.split("&");
    var protID = remURI[1].split("=");

    var s = remURI[2].split("=");

    document.getElementById('txtPlanID').value=pID[0];
    document.getElementById('txtProtID').value=protID[1];
    document.getElementById('txtSeqNo').value=s[1];

//show("block");
return false;
}
</script>

But the problem is that I have to click twice on hyperlink to get desired result.
I think onClick event is executing before sending query string.
Please let me know if there is anything wrong in source code.

Thanks in advance…..

  • 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-16T08:41:09+00:00Added an answer on June 16, 2026 at 8:41 am
    <td> <a href="#" onclick="getValues('<%=data[i][0]%>','<%=data[i][1]%>','<%=data[i][2]%>');" >Edit</a></td>
    
    
    function getValues(pID,protID,eq)
    {
    
    document.getElementById('txtPlanID').value=pID;
    document.getElementById('txtProtID').value=protID;
    document.getElementById('txtSeqNo').value=eq;
    
    //show("block");
    return false;
    

    }

    simply pass values while calling javascript get use it

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a web application using JSP and Servlets. I wants to call
I am developing a web application using JSP and Servlets. In that application I
I am using Spring Web MVC and Hibernate for developing my application. My login.jsp
I'm developing a java servlet web application that manages information from multiple databases (all
I am developing a web application using django, postgreSQL, html5 and javascript. The application
I am developing a dynamic JSP/Servlet web application. In order to handle the session,
I developing a web application using GWT where i am trying to upload a
I am developing a web application using Java/JSP. One class, say Student, has a
I am developing a web application (using classic asp for now) that needs to
Here is the scenario: I am developing a web application written in servlet JSP.

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.