Beta

Slashdot: News for Nerds

×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Don't ever call submit submit

ynotds (318243) writes | more than 6 years ago

User Journal 0

This really should have been a headline item in HTML 101 but it is surprisingly difficult to find a quick explanation of the non-obvious diagnostics which eventually led me to a relatively simple problem.

When there is a namespace clash in JavaScript, properties outrank methods.

This really should have been a headline item in HTML 101 but it is surprisingly difficult to find a quick explanation of the non-obvious diagnostics which eventually led me to a relatively simple problem.

When there is a namespace clash in JavaScript, properties outrank methods.

When you name a submit button, that name becomes a property of the containing form. Assuming the containing form tag says name='myformname', the very useful document.myformname.submit() method becomes unreachable.

And the obvious answer, changing the form name, becomes impossible to contemplate when your main client's business-defining intranet is built on middleware which calls every submit button submit so that progress through a process is represented by values of $in{'submit'}.

I've even relatively recently added code which logs $in{'submit'} along with other details of every process that is run so we can learn more about actual usage patterns.

cancel ×

0 comments

Check for New Comments
Slashdot Account

Need an Account?

Forgot your password?

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>
Create a Slashdot Account

Loading...