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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:51:55+00:00 2026-05-19T04:51:55+00:00

I have some troubles with confirm dialog not working with Firefox, but working with

  • 0

I have some troubles with confirm dialog not working with Firefox, but working with Chrome.

html code looks like this:

<input type="submit" name="Odjava" value="Remove selected link" onclick="return odjava(somelink,'Do you really want to remove ')"/>

javascript code looks like this:

function odjava(link,text)
{
    if(link=="" || text=="")
        return false;
    return confirm(text + link + " ?");
}

With Chrome, everything is ok – onClick generates “confirm” dialog, and if user answer with “yes”, form is submitted, otherwise it’s not. Firefox doesen’t show “confirm” dialog, it just submits the form.

Why’s that? What am i doing wrong?

****EDIT:
I got it! I just changed my javascript to look like this:

function odjava(text)
{
    var linkovi = document.getElementById('linkovi');
    link = linkovi.options[linkovi.selectedIndex].text
    if(link=="" || text=="")
        return false;
    return confirm(text + link + " ?");
}

and it’s working. It turn out that Chrome can find element in document even without document.getElementById, FF can’t (won’t)!

  • 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-19T04:51:56+00:00Added an answer on May 19, 2026 at 4:51 am

    Is somelink defined safely in both Firefox and Chrome?

    When I try your code it works successfully in both FF and Chrome if someLink is defined, and fails to work as you describe in both if it is not defined.

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

Sidebar

Related Questions

I have some troubles with parsing matrix file. It looks sth like this: #
I have some HTML that looks like this: <ul class=faq> <li class=open> <a class=question
I have some troubles with positioning my label/password field. With this code they both
I have some troubles with this small JavaScript code: var text=Z Test Yeah !
i have some troubles implementing this layout: http://deconcini.net/maurer-schneebacher/projekte/elisabethinum.html Basically i would like to display
I have some troubles mapping a JSON Array to RestKit. This is what the
I have some troubles with receiving data on server side. Here goes the code:
I'm trying to start my java game but I have some troubles with the
I have some troubles with saving a image from memorystream. Here is my code:
I feel like this question ought to have been covered, but I can't seem

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.