473,604 Members | 2,487 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 3504
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
1945
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
1943
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
3362
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
5271
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
17074
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
2985
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
2204
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
3190
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
4767
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
7997
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8419
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...
0
8409
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8065
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
8280
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...
1
5882
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
5441
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();...
0
3955
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2434
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.