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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:07:00+00:00 2026-06-12T03:07:00+00:00

Question: Any ideas how to NOT trigger the confirmOption function on page load, and

  • 0

Question: Any ideas how to NOT trigger the confirmOption function on page load, and only trigger it when the button is clicked?

So in my html body i have:

<Body>
<a href="#" id="btn_YES" onclick="<%="send('YES','" + rm.getAction ("YES") + "'); return (false);"%>" class="actionBtn"><span><span>Yes</span></span></a>&#160;
            <a href="#" id="btn_NO" onclick="<%="send('NO','" + rm.getAction ("NO") + "'); return (false);"%>" class="actionBtn"><span><span>No</span></span></a>&#160;
</Body>

Javascript functions that have been working fine:

function send(button, url) {
    if (opener.document && opener.document.forms[0] && (opener.document.forms[0].elements['sessionToken'] || opener.document.forms[0].elements['screenID']))
         {
                                opener.answer(button, url);
                                window.close();
                            } else { 
                                return false;
                            }
                        }   

getAction and confirmOption(String option) are declared in java. If confirmOption is evaluated, it will output in the console YES or NO

function setConfirm(userSelection){
        if(userSelection="YES") result = "<%=mb.confirmOption("YES")%>"; 
        if(userSelection="NO") result = "<%=mb.confirmOption("NO")%>";
}

When i load the page, why does it print in my console:

YES
NO

, even before i clicked on the button? My breakpoint on java was triggered, so i can see that the method was being evaluated on page load – when it shouldn’t because it should be triggered when the button is clicked.

When i clicked on the button, my breakpoint was NOT triggered and i was sent to the relevant page.

Any ideas how to NOT trigger the confirmOption function on page load, and only trigger it when the button is clicked?

  • 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-12T03:07:02+00:00Added an answer on June 12, 2026 at 3:07 am

    they wont be evaluated onload. They will get evaluated as soon as browser finds them during loading although you can defer evaluation and in the above can you are actually calling the function remove quotes

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

Sidebar

Related Questions

I'm not finding any question specifically with the odd problem I have. Basically I've
Any Ideas? I asked the question "Is it possible to have a default parameter
Well - exactly as the question subject states - any ideas on how you
Note: There was not any question with this kind of problem here or anywhere...
Hey just a quick question for any experts out there. I have a site
Sorry about the extremely vague question title (any suggestions for improvements welcome) I have
I have two timers that each immediately trigger an async postback once the page
PLEASE NOTE: This is a CODE QUESTION NOT AN SYSTEM MANIPULATION ONE. I have
An odd question this will be, but here goes. I have a page on
This is not just another FileUpload + UpdatePanel question. I have, as stated in

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.