为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

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

所有回复 (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.