473,837 Members | 1,448 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Safari interprets 'submit()' as method 'POST'

I ran into an interesting problem while working on a form:

I have a drop down list (think <form><select>< option>...) of 'open
sessions' which a user can choose from to continue entering data.
There is a small bit of javascript which, when the 'onChange' event
occurs, triggers a 'submit' which reloads the page and displays the
stored values for that session using a session ID variable named,
'$existingSessi ons'.

Even though the form's method is set to "GET", Safari insists on
seeing this as a "POST" as a result of the javascript submit call,
while all other browsers I tested (Firefox/Mac, IE/Mac, Firefox/PC,
IE7/PC) interpret this as a "GET".

So at the top of the PHP script, $existingSessio ns =
$_POST['existingSessio ns'] will ONLY work with Safari while all other
browsers (which I tested) require $existingSessio ns =
$_GET['existingSessio ns'] in order to retrieve the values.

Has anyone else run into this issue? I handled it with a simple
HTTP_USER_AGENT request and an if...else statement. Still, I'd like to
know what's up with this! Is it just because Safari is a semi-sucky
browser?

May 11 '07 #1
1 3516
On May 11, 10:53 am, ryn...@gmail.co m wrote:
I ran into an interesting problem while working on a form:

I have a drop down list (think <form><select>< option>...) of 'open
sessions' which a user can choose from to continue entering data.
There is a small bit of javascript which, when the 'onChange' event
occurs, triggers a 'submit' which reloads the page and displays the
stored values for that session using a session ID variable named,
'$existingSessi ons'.

Even though the form's method is set to "GET", Safari insists on
seeing this as a "POST" as a result of the javascript submit call,
while all other browsers I tested (Firefox/Mac, IE/Mac, Firefox/PC,
IE7/PC) interpret this as a "GET".

So at the top of the PHP script, $existingSessio ns =
$_POST['existingSessio ns'] will ONLY work with Safari while all other
browsers (which I tested) require $existingSessio ns =
$_GET['existingSessio ns'] in order to retrieve the values.

Has anyone else run into this issue? I handled it with a simple
HTTP_USER_AGENT request and an if...else statement. Still, I'd like to
know what's up with this! Is it just because Safari is a semi-sucky
browser?
To resolve this at the PHP end, you can just use $_REQUEST instead
which is a combination of $_GET, $_POST, and $_COOKIE.

To resolve this in the browser, you can create a submit button in the
form next to the jumpbox, and in the onchange for the jumpbox do
document.forms['whatever'].elements['goBtn'].click()
Note that I mean the name attribute of the go/submit button is
'goBtn'. This method will also allow people who don't have JavaScript
enabled to use the go button to change the session. I've run into
strange behavior with form.submit() before, and I had to use
submitBtn.click () instead. I'm not absolutely sure this solution will
fix your problem at the browser end, but it usually fixes my problems
with form.submit().

-Mike PII

May 11 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1957
by: bob | last post by:
I hope this is the right group to ask. I need help from a safari guru. I seem to have problems getting safari web browser to execute perl scripts. The code I have is pretty standard. My html code is <form action="cgi-bin/webre.pl" name="form1" method="post"></form> <textarea name="" cols="60" rows="5" id=" "></textarea>
1
1959
by: gerry | last post by:
Hi, although this is not strictly asp.net related, I was hoping that someone could confirm or debunk what appears to be a major problem with safari POSTs. with the following html : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <HTML> <HEAD>
2
3391
by: JThomas | last post by:
Hello! I'm having trouble with a page apparently causing my client's Safari browser to time out. I don't actually have access to a Mac & Safari, and haven't been able to physically see this duplicated, but this is the descrip of the problem: >From Client's Point of View: 1. Client, using Safari, fills out a form on one page, submits (POST). 2. Timeout - never sent to next page (submit button is working, but
6
5280
by: dpodkuik | last post by:
I have a simple function that does submit for me: <script language="javascript" type="text/javascript"> function sort() { //selected item value from the drop down list var dud=window.document.statusForm.sortByStaff.value; window.document.statusForm.action="status.cfm?sortBy="+dud; window.document.statusForm.method="post";
2
17086
by: cbjewelz | last post by:
Hey all. So I'm having problems with cross browser alignments. I'm looking at Safari and Mozilla Firefox. I develop in Safari and so it looks perfect there however in Firefox my vertical alignments and div widths are off. It's as if firefox has a different definition of a pixel than safari. Here is the url: http://theprize.chemouni.com/testing.php. When you select the Option from the pull down, the first part of the form appears. Then when...
2
2997
by: darren | last post by:
I have a small Javascript problem with that mutch love web browser safari, I tested the code on all other browsers PC (Win) and Linux and IE on the mac and it seams to work ok, but for some reason it will not work with safari. function domywindows() { //alert('test'); mywondows = window.open('writeme.html','TellAFriend','width=450,height=600'); mywondows.document.write("<html>");
5
2216
gregerly
by: gregerly | last post by:
Ok, I've got an ajaxed calendar that lets users add their own events. This works great in Firefox and IE. In Safari however, i'm getting errors as the response text, instead of the success or failure message. My javascript is below: submitButton.onclick=function(){ //set up all neccessary variables var screenname=$F('screenname'); var month=$F('month'); var day=$F('day'); var year=$F('year'); var...
1
3201
by: Jacqui | last post by:
Hi, I am trying to write a webpage that has a form on it, which gets submitted when a button is pressed, but also has an onclick event which does some DOM manipulation to display a waiting page. The issue that I am facing is that in Safari, a blank screen is being displayed rather than the waiting page. This is only happening if there are form tags around the button
2
4778
by: rudiedirkx | last post by:
Gents, I have a problem (only in Safari) with the onsubmit in webforms. This topic covers the same subject: http://bytes.com/topic/javascript/answers/166542-onsubmit-safari but not as detailed as I will. Let me illustrate the problem with examples. The HTML: <html> <head> <script type="text/javascript" src="/js/mootools_1_11.js"></script>
0
9682
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10874
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10623
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10271
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9398
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7806
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7000
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
4040
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3124
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.