Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

Den här webbplatsen har begränsad funktionalitet medan vi utför underhåll för att förbättra din upplevelse. Om en artikel inte löser ditt problem och du vill ställa en fråga har vi vår gemenskap som väntar på att hjälpa dig på @FirefoxSupport på Twitter, /r/firefox på Reddit.

Sök i support

Akta dig för supportbedrägerier: Vi kommer aldrig att be dig att ringa eller skicka ett sms till ett telefonnummer eller dela personlig information. Rapportera misstänkt aktivitet med alternativet "Rapportera missbruk".

Läs mer

Form submission is not responding in Firefox version 55 and above

more options

I have a form which will be submitted either in same window or in new tab based on radio button selection. There are two radio input buttons (radioA and radioB) and a button element (submitButton) which will handle form submission using javascript. By default, form will have target value as _self.

  • If radioA is selected by user and on click of submitButton, target value will be changed to "_self" (only if it is _blank) and form will be submitted using javascript (document.formName.submit();).
  • If radioB is selected by user and on click of submitButton, target value will be changed to "_blank" (document.formName.target="_blank") and form will be submitted using javascript (document.formName.submit();).

The above functionality is working fine in all browsers except Firefox version 55 and above. I noticed that latest versions of Firefox is not responding when target value is changed. To confirm this i skipped the logic to modify target value and noticed the functionality working even in latest Firefox versions.

Could you please let me know if this is a known issue or when this will be resolved. And let me know if more details required.

Thanks, Nanda

I have a form which will be submitted either in same window or in new tab based on radio button selection. There are two radio input buttons (radioA and radioB) and a button element (submitButton) which will handle form submission using javascript. By default, form will have target value as _self. * If radioA is selected by user and on click of submitButton, target value will be changed to "_self" (only if it is _blank) and form will be submitted using javascript (document.formName.submit();). * If radioB is selected by user and on click of submitButton, target value will be changed to "_blank" (document.formName.target="_blank") and form will be submitted using javascript (document.formName.submit();). The above functionality is working fine in all browsers except Firefox version 55 and above. I noticed that latest versions of Firefox is not responding when target value is changed. To confirm this i skipped the logic to modify target value and noticed the functionality working even in latest Firefox versions. Could you please let me know if this is a known issue or when this will be resolved. And let me know if more details required. Thanks, Nanda

Alla svar (2)

more options

Please submit the URL for us to look.

Or run your code by URL or Upload to : W3C.org (World Wide Web Consortium) in charge of standards and practices and future development of web pages and web browsers make the rules on code. Mozilla Firefox follows these rules. W3C.org Who make the rules for web code. HTML https://validator.w3.org/ CSS https://jigsaw.w3.org/css-validator/ and https://validator.w3.org/i18n-checker/ and http://mobile.css-validator.org/

more options

Do you notice any errors in the Browser Console when you toggle the radio buttons or click Submit? See:

https://developer.mozilla.org/docs/Tools/Browser_Console

Does the target attribute get added as expected?

You could try using an onsubmit handler on the form element for this.

<form action="path/to/script" name="f1" onsubmit="targetf1">

function targetf1(){
  if (radioB.checked) {
    document.f1.target = '_blank';
  } else {
    document.f1.target = '_self';
  }
  return true;
}

That was "air code" I haven't actually tested.