homepage Welcome to WebmasterWorld Guest from 54.166.8.138
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Will your site still work with the new Mac Safari
The new format for Mac's safari brower will break most sites
Demaestro




msg:607109
 11:19 pm on Dec 19, 2003 (gmt 0)

Do you have a form that lives on a page of your site that posts to itself?

Do you not specify an action inside the form tag when it posts to itself?

Well at my company we use this logic in all of our form validation so that if the form comes back as incomplete all its values are easily retrievable.

It has just come to our attention that the new Safari Browser for the Mac, now that IE has left the Mac OS, will redirect to the front page of a site if a form is submitted without a specified action.

In all browsers, currently if you have a form tag with no action it will submit to itself. This will not be the case with the new Safari and Konquerer browsers.

I dont know about your sites but I know mine all need to have changes made so that forms that are posting to themselves have an action that will specify the page as the action. Over 350 sites that we manage will need this new change on at least one page per site, some of our shop sites have 50-100 pages where this change will be needed.

Thanks Mac for abandoning even more of your users from a nice web surfing experience. Like we devolpers don't have enough consessions to make in our code to accomodate your users

In case my anger has masked the meaning of this post, here is a summary.

<form method="post">

This will now submit to the front page of a site in the new Safari and Konquerer. Where as before ANY and EVERY browser would post the form to the page it came from.

Be warned it seems like soon we will need 2 URLs for every site, one for Mac users and one for everyone else.

 

too much information




msg:607110
 11:38 pm on Dec 19, 2003 (gmt 0)

I've been all over with Safari and not one problem here. Sticky me your URL so I can see what you mean.

Also, I've found that Safari and NS7 (for Windows) behave the same. If you check your logs, the UA for Safari says "like Gecko" so you may want to download a version of NS7 and see if it may be your code and not Safari. (just a suggestion)

victor




msg:607111
 11:43 pm on Dec 19, 2003 (gmt 0)

I can appreciate you are angry and may have a lot of work to do to either correct the problem, or persuade Apple to change their browser.

But action= is a required part of the <form> definition:
[w3.org...]

You've got away with using a quirk, and you now have the first indication that it won't work in the future. Today MACs, tomorrow all browsers?

andy_boyd




msg:607112
 11:53 pm on Dec 19, 2003 (gmt 0)

I use Safari all the time alongside Camino. The only site that I have come across which does not function as it should do on both browsers ( Safari 1.1.1 / Camino 0.7 + ) is easyJet's website. It performs so erratically, sometimes I can get flight times to display, other times it won't. I most certainly cannot book flights using either browser.

Both browsers are solid, and both will get much better over time. Let's remember that Safari is only in the public domain for just under a year. If you check out Dave Hyatt's blog on Mozillazine.org you can see what they are working on for future releases, if that is of any help.

Demaestro




msg:607113
 11:54 pm on Dec 19, 2003 (gmt 0)

I know that Safari isnt doing this yet but it is on the next release.

I know that W3 lists it as 'required' but when all browsers do it one way why start going away from that?

We had an earlier issue where safari would give a cookie the value of 'deleted' rather than deleting the cookie. This was causing all sorts of problems and I seem to have more and more code that does one thing for mac and another for everyone else.

We need more continuity among browsers we don't need them all doing different things.

Don't get me wrong I am not bashing any one browser, if I were it would be IE I promise you that. But I don't get why they are basing the new Konquerer and Safari on an unused browser.

stevenha




msg:607114
 12:02 am on Dec 20, 2003 (gmt 0)

I used method="POST" action="" in my forms, in order to get the W3C validation websites to stop flagging my site as containing errors. This will work. You certainly have my sympathies regarding the large amount of work you have ahead of you.

iamlost




msg:607115
 12:13 am on Dec 20, 2003 (gmt 0)

Demaestro: you are quite right:

We need more continuity among browsers we don't need them all doing different things.

However the only way for browser compatability is a standard. As borowsers become more standards compliant we will (and are) seeing greater compatability.

Therefore as has been said in almost every forum here it is "best practices" to write clean code and only then make adjustments for non-compliant browsers.

It may be of benefit to validate your sites (as time permits!) so that you are able to pre-empt future problems. The web and how we view it is in constant change - NN4 is not that long ago, neither is IE3, nor for that matter Mozaic.

The only protection we, as webmasters, have is standards compliance; without valiadation and compliance the chaos that would accompany browser change would be horrendous.

Demaestro




msg:607116
 1:53 am on Dec 21, 2003 (gmt 0)

It is my understanding stevenha that the action="" will still be redirecting to the front page of the site. I stand to be corrected but thats what the Tec guys at my work are saying about the new releases.

killroy




msg:607117
 2:02 am on Dec 21, 2003 (gmt 0)

Sorry if this off topic, but I need to vent this... why oh why is an ampty tag neccessary. Why can't it simply default to a blank state? I have never understood this. (i.e. action or alt)

SN

dcrombie




msg:607118
 11:05 am on Dec 21, 2003 (gmt 0)

You must have a valid action - "" is the same as no action. The Alexa site has this problem on a couple of forms. I find the easiest solution is to use action="<?= $PHP_SELF?>" or similar.

It's not just Safari that requires this, and not just FORMs - I had some sites from 4-5 years ago where I was using <A href=""> which now doesn't work in IE - you have to use <A href="/"> or similar.

So IE broke the standard in the last few years - quel surprise! That's why one of the golden rules of web development is to NEVER develop in IE.

amznVibe




msg:607119
 11:20 am on Dec 21, 2003 (gmt 0)

Heck, Safari *still* doesn't receive gzip compression (even in 1.1) so it's hard to take it seriously on any technical level (even netscape 4.7 does gzip). It also has absolutely no way to debug javascript.

There are a bunch of other bugs [dhtmlkitchen.com], some rather interesting.

hartlandcat




msg:607120
 12:13 pm on Dec 21, 2003 (gmt 0)

This will now submit to the front page of a site in the new Safari and Konquerer. Where as before ANY and EVERY browser would post the form to the page it came from.

Konqueror is NOT a "new" browser -- it's been around for several years.

I've been using Safari for about the past month, and I've never encountered any problems with any website.

Oaf357




msg:607121
 2:41 pm on Dec 22, 2003 (gmt 0)

It boils down to keeping pages standards compliant.

More and more browsers are conforming to standards these days so if you're not developing standards complaint web sites you're making more work for yourself later.

dcrombie




msg:607122
 3:06 pm on Dec 22, 2003 (gmt 0)

At least Safari has a "countable" number of bugs ;)

...and they're being fixed [weblogs.mozillazine.org]!

stevenha




msg:607123
 3:28 pm on Dec 22, 2003 (gmt 0)

I don't have a Mac to do testing with, so I have to rely on the advice of others. Is it really your advice that I should put action="<?= $PHP_SELF?>" into my forms? ( I don't understand that syntax, and I'm wondering if there are any simple alternatives?)

dcrombie




msg:607124
 3:36 pm on Dec 22, 2003 (gmt 0)

That's a PHP tag to insert the address of the current page as the action. It will only work if you're using PHP. It's short-hand for:

<?PHP
echo "$PHP_SELF"; # address of current page
?>

You can achieve the same using other languages, but probably not as easily.

Demaestro




msg:607125
 4:09 pm on Dec 22, 2003 (gmt 0)

Stevenha RE>that I should put action="<?= $PHP_SELF?>" into my forms? ( I don't understand that syntax, and I'm wondering if there are any simple alternatives?),

Look at the output of your REQUEST object, there should be a object in there that has the URL of the current page you are on. In mine it is URL1. It always equals the URL of the page I am on. so my <action="REQUEST.URL1"> depending on what you use to render pages the syntax will vary on how you spew the value of the REQUEST object values into the form tag.

stevenha




msg:607126
 4:31 pm on Dec 23, 2003 (gmt 0)

Thanks for replying demaestro. I'm afraid that I didn't understand your references to an object named URL1. Is this one of those DOM thingies? Could you illustrate its use with some example code? Thanks. Steve.

Demaestro




msg:607127
 5:04 pm on Dec 23, 2003 (gmt 0)

stevenha >> I use a platform called ZOPE and I don't know what you are using, but here is some more info that might help.

The REQUEST object holds variables that can be called from your pages. Query String variables end up living in the REQUEST object.

Some of the REQUEST objects variables are always there. For example there is the HTTP_USER_AGENT variable that when called will display the user's browser info. There is another called HTTP_X_FORWARDED_FOR, this variable holds the IP addresss of the user that is viewing the page. There are also a bundle of variables called URL, URL1, URL2 ...and so on. Now this is on my platform mind you.

What you need to do is find out the what your REQUEST object's variable names are, they vary depending on the platform you are using. If you are going straight .html pages I am not sure how to do this. In .asp I think you can call the REQUEST object's variables by doing something like REQUEST.variableName.value in vbscript

I am not sure what compiler you are using on your server machine. But I am sure that whatever books you have on the subject will have info about the REQUEST object's variable names. And of course you can always keep posting here for info.

Let me know how it goes.

stevenha




msg:607128
 6:13 pm on Dec 23, 2003 (gmt 0)

I was hoping to avoid compiling anything or doing any server-side processing. I was hoping you or someone could suggest the correct html syntax for a form action that refers to its own page. For example, if your html page is "bmi.htm", do you put action="bmi.htm" into your form statement? Is there a generic way to refer to the current pagename, instead of typing the actual name?

Demaestro




msg:607129
 6:23 pm on Dec 23, 2003 (gmt 0)

Stevenha if you want it to be a generic way to refer to the current page rather than typing in the name it will have to be server side compiled. I dont think there is anyother way around it.

The info in your REQUEST object is still your best bet as far as I can tell. Of course it does depend on what you are scripting in. Whichever tool you are using for logfile reporting is tapping into those REQUEST variables to track hits, IPs, referers and whatnot. So all the info is there for you to use you just need to find how to get ahold of those REQUEST object variables and dump the value of the current page into the action tag of your forms.

dcrombie




msg:607130
 7:43 pm on Dec 23, 2003 (gmt 0)

You can do something with JavaScript but it's not so pretty:

<SCRIPT type="text/javascript">
document.write ("<FORM method=\"post\" action=\" + self.location.href + "\">");
</SCRIPT>
<!-- put your form elements here -->
<INPUT type="submit" value="Submit to self">
</FORM>

;)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved