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 5976575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:14:54+00:00 2026-05-22T21:14:54+00:00

I have a Java page that uses embedded JavaScript to create a confirmation message

  • 0

I have a Java page that uses embedded JavaScript to create a confirmation message (I’m using window.confirm). I would like to use the results of the user’s selection (either “Yes” or “No”) outside of that JavaScript snippet but I’m not sure how. To clarify, I know how to check the user’s selection in JavaScript but I am trying to pass that along to rest of the page, which is written in Java.

Supose I saved that result in a hidden field on the client side and wanted to pass that value as an argument back to the server to be used in Java. Would that be possible? And if, so, what is the correct synthex to access the value of that hidden field or other intermediary object?

UPDATE: The decision is to whether or not I want to save a record to a database. Clicking on the Save button brings up the Confirmation box (written in JavaScript) and also triggers a postback triggering and within a DoGet event that follows I would like to be able to tell what the result was so that I can know whether or not to proceed with saving.

There may be a delay in my future responses.

UPDATE #2: I was able to find a solution. To prevent the postback from happening after clicking the “No” button. I just needed to add:

{ event.returnValue = false; return false; } // simply using return false by itself didn't help

This page really helped:

  • 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-05-22T21:14:55+00:00Added an answer on May 22, 2026 at 9:14 pm

    Yes, you can dynamically add a <input type="hidden" name="yes"/> tag to a form and then let the user submit the form when ready.

    Or you can use Ajax–which also has the advantage of being able to work asynchronously (without necessitating an entire page refresh).

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

Sidebar

Related Questions

I am using Struts and Java. The problem is that I have a page
I have a Java JApplet embedded in a web page. The JApplet window contains
I have a Java Applet that is generating an image. Ultimately, I would like
I have main page that looks like this: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html
I have a java program that uses ProcessBuilder to call the unix sort command.
We have a Java server back-end that uses Apache XML-RPC to make its services
I have written a program that uses the Java print API to print pages
I want to have java script clicking a link on the page..I found something
On a JSTL/JSP page, I have a java.util.Date object from my application. I need
Hi I have a page in my java/jsp based web application which shows list

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.