What is the work around for a weird javascript form representing an error in Safari 5?

I'm not sure if this is an existing error, but after debugging the web application I'm working on, I found some weird behavior in Safari 5. Here is the scenario:

Page A ---- HTTP POST ----> Page B ---- HTTP POST ----> Page C

Page A:

<body onload="document.forms[0].submit()"> <form method="post" action="pageB.php"> <input type="hidden" name="display" value="ABC" /> </form> </body> 

Page B:

 <body onload="document.forms[0].submit()"> <form method="post" action="pageC.php"> <input type="hidden" name="display" value="123" /> <input type="hidden" name="extra" value="XXX" /> </form> </body> 

Page C:

 <body> <?php print_r($_REQUEST); ?> </body> 

Of all the browsers that I have tested so far, only Safari 5 (Mac version) displays the value “ABC” to display name = ", and I can still see the value“ XXX ”for the“ extra ”field. All other browsers ( including Safari 3, 4) will display the value "123", which is the correct value.

For some reason, I still need to submit the form using for pages A and Page B, with this condition, what is the workaround for Safari 5? (To force him to enter the correct value on page B, which should be 123 instead of sorting, for example, transferring the value from page A to page C)

Many thanks!

  • Edit1: only happens on Mac OS (Snow Leopard, Lion) Safari 5
  • Edit2: Make the example clearer
+4
source share
2 answers

Safari fills out a form field using autocomplete behavior . You probably have the “Other Forms” option in your preference. Even Apple recommends disabling this feature, as it can be used to steal confidential information.

To get around this for the people who turned it on, try <form autocomplete="off">

+4
source

Launch a proxy server, for example Fiddler http://www.fiddler2.com/ , and make sure that these messages move between forms. If this happens only in this one browser on this machine, it looks more like a browser cache than a form error message. What if you start with pageB? What if I clear the cache first?

0
source

Source: https://habr.com/ru/post/1411924/


All Articles