473,474 Members | 1,822 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Strange Safari onClick problem

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

i.e., this works and brings up the waiting page:

<input type="submit" name="submit" onclick='return interstitial();'/>

whereas this does not:

<form method="get" action="<slow loading page>">
<input type="submit" name="submit" onclick='return
interstitial();'/>
</form>

This does not appear to be a problem in Firefox/IE. Has anybody else
faced this problem and would be willing to help me out with this?

Many thanks in advance,
Jacqui
Jun 27 '08 #1
1 3180
VK
On Apr 21, 12:57 pm, Jacqui <jasn...@ntlworld.comwrote:
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

i.e., this works and brings up the waiting page:

<input type="submit" name="submit" onclick='return interstitial();'/>

whereas this does not:

<form method="get" action="<slow loading page>">
<input type="submit" name="submit" onclick='return
interstitial();'/>
</form>

This does not appear to be a problem in Firefox/IE. Has anybody else
faced this problem and would be willing to help me out with this?
<form method="GET"
action="slow_loading_page.cgi"
target="hidden_frame"
onsubmit="return interstitial(this)">
<!-- other form elements -->
<input type="submit">
</form>
<iframe name="hidden_frame" src="blank.html"
style="display: none !important"></iframe>

where

where interstetial does validation, sets waiting message and returns
true

Because form submission means leaving the current page, you have to
dump the server output to a hidden frame, otherwise it has no sense to
display any DOM waiting message - they will disappear a ms later.

If you are using an ajaxoid to submit your form then respectively you
have to cancel form submission and do the job manually, in such case
iframe is not needed:

<form method="GET"
action="slow_loading_page.cgi">
<!-- other form elements -->
<input type="button" value="Submit"
onclick="interstitial(this.form)">
</form>

1) interstitial has to show waiting message first, then over
setTimeout proceed with form submission: otherwise the screen will
never be updated.
2) a fallback should be provided in case Javascript disabled. One of
options:

<script>
document.write(''.concat(
'<input type="button" value="Submit"',
' onclick="interstitial(this.form)">'));
</script>
<noscript>
<input type="submit">
</noscript>
Jun 27 '08 #2

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

Similar topics

1
by: timchalk | last post by:
I believe I've found a problem with the Safari DOM when updating the text found within a layer. Although the layer is updated correctly visually, the underlying DOM seems to grow larger with...
3
by: Joe Cox | last post by:
I am having a problem with style properties for dynamic images in Mac OS X Safari. By dymanic images, I mean images allocated with the javascript 'new Image()' call. With static images (created...
2
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...
12
by: effendi | last post by:
I wrote the following function and tested it in MSIE, Firefox and Mac Safari, Works in all but the Safari. What can I do to rectify this? function processBackground(){ for (n=1;n<11;n++) { ...
7
by: ja | last post by:
Hi, I've made an pseudo-select, wich using DOM functions like: document.createElement() appendChild() document.getElementById() with(obj){
5
by: luckydenis2007 | last post by:
I am trying to access image information that is displayed using iframe. iframe code looks like this: <iframe id="testImage" src="/images/someimg.gif" scrolling="yes" frameborder="0"...
10
by: Tim Streater | last post by:
I have a form and a button to submit it. The button is made from: <input type=button onclick='myHandler(this.form);'> This all works fine except that in Safari 2.0.4, the enter/return keys, if...
2
by: Andrew Poulos | last post by:
Testing locally on an Win XP box with the safari pop up blocker disabled: window.close(); will close the window without warning even though the window was not opened by javascript. win =...
0
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...
1
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...
0
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...
1
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...
0
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
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...

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.