473,412 Members | 2,012 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

how to blank the screen when any submit-type buttons clicked

Is there a way to blank the screen in a FORM's onsubmit=... to blank
the screen for the user??

I asked this before and got a way to blank a table by id with

"document.getElementById('tabid').style.display='n one';" in the onclick
event and setting the encapsulating table's ID to 'tabid'.

I was wondering if this or some other similar approach that could
possibly be planted globally in my pages in the onsubmit validation
sequence ????

Oct 3 '05 #1
14 2589

"charlie_M" <cm******@comcast.net> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Is there a way to blank the screen in a FORM's onsubmit=... to blank
the screen for the user??

I asked this before and got a way to blank a table by id with

"document.getElementById('tabid').style.display='n one';" in the onclick
event and setting the encapsulating table's ID to 'tabid'.


you could put your "page" content in a div and then just hide the whole
div.
Oct 3 '05 #2
Can you nest DIVs??

The problem and the reason I ask the original question... these pages
are written in Foxpro and there are literally hundreds of them. I am
loking for the easiest method to blank the screen when sublitted and
would favor the method that would allow trhe change be centrally
applied (like a form's onsubmit()).

TIA
Chuck

Oct 3 '05 #3
charlie_M said the following on 10/3/2005 3:45 PM:
Can you nest DIVs??
Yes. What does that have to do with Javascript?
The problem and the reason I ask the original question... these pages
are written in Foxpro and there are literally hundreds of them. I am
loking for the easiest method to blank the screen when sublitted and
would favor the method that would allow trhe change be centrally
applied (like a form's onsubmit()).


If Foxpro is screwing your pages up that bad, you need a new editor.

<form onsubmit="hideTheBody()">

function hideTheBody(){
bodyNode = document.body?document.body:document.documentEleme nt;
bodyNode.innerHTML = '';
}

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Oct 3 '05 #4
Does this allow the form to be submitted?? My initial test shows the
screen blanks.. but the data does not go to the server??
FYI:. Foxpro is not an editor.... also not javascript ;o)) Foxpro is a
fuly compiled language with similarities to Visual Basic and C++ and
the ilk. In this case... Foxpro is generating/interpreting web pages
and serving them through an isapi interface to/from a webserver.

Oct 4 '05 #5
Randy Webb wrote:
charlie_M said the following on 10/3/2005 3:45 PM:
Can you nest DIVs??

Yes. What does that have to do with Javascript?
The problem and the reason I ask the original question... these pages
are written in Foxpro and there are literally hundreds of them. I am
loking for the easiest method to blank the screen when sublitted and
would favor the method that would allow trhe change be centrally
applied (like a form's onsubmit()).

If Foxpro is screwing your pages up that bad, you need a new editor.

<form onsubmit="hideTheBody()">

function hideTheBody(){
bodyNode = document.body?document.body:document.documentEleme nt;
bodyNode.innerHTML = '';
}


That doesn't work, by the time the submit runs, there is nothing left to
submit (or was that the intention?).

Try:

function hideTheBody()
{
bodyNode = document.body? document.body : document.documentElement;
if (bodyNode.style){
bodyNode.style.display = 'none';
}
}

However, it seems like a very bad idea - why not just write 'The form is
being submitted' or similar to the page in a faux message dialog?.

--
Rob
Oct 4 '05 #6
charlie_M wrote:
Is there a way to blank the screen in a FORM's onsubmit=... to blank
the screen for the user??

I asked this before and got a way to blank a table by id with

"document.getElementById('tabid').style.display='n one';" in the onclick
event and setting the encapsulating table's ID to 'tabid'.

I was wondering if this or some other similar approach that could
possibly be planted globally in my pages in the onsubmit validation
sequence ????


If you have some sort of global onsubmit function , you most certainly
could blank the screen or just about anything else.

I would broabably not choose display:none , as it confuses some browsers
as relates to the content of the container becomming not only invisible,
but occasionally inacessible to script. perhaps if you simply take the
div with the form in it and adjust the left or top to a location that is
-x and/or -y enough to be off screen.
--
--.
--=<> Dr. Clue (A.K.A. Ian A. Storms) <>=-- C++,HTML, CSS,Javascript
--=<> Internet Programming since 1994 <>=-- DHTML NSAPI TCP/IP
--=<> http://resume.drclue.net <>=-- AJAX, SOAP, XML, HTTP
--=<> http://www.drclue.net <>=-- SERVLETS,TCP/IP, SQL
--.
Oct 4 '05 #7
Dr Clue wrote:
charlie_M wrote:
Is there a way to blank the screen in a FORM's onsubmit=... to blank
the screen for the user??

I asked this before and got a way to blank a table by id with

"document.getElementById('tabid').style.display='n one';" in the onclick
event and setting the encapsulating table's ID to 'tabid'.

I was wondering if this or some other similar approach that could
possibly be planted globally in my pages in the onsubmit validation
sequence ????

If you have some sort of global onsubmit function , you most certainly
could blank the screen or just about anything else.

I would broabably not choose display:none , as it confuses some browsers
as relates to the content of the container becomming not only invisible,
but occasionally inacessible to script. perhaps if you simply take the
div with the form in it and adjust the left or top to a location that is
-x and/or -y enough to be off screen.


The following hides just the form, but it could hide the entire body.

There are some usability issues here - what happens if the submit fails?
The user now has a blank page and must work out that they need to
refresh the page rather than navigate 'back' - how is that really any
different to learning that they should only submit once and wait?

If the submit takes a while and the page stays blank, will they hang
around or just go elsewhere and possibly screw-up whatever process they
were engaged in?

Why attempt to teach non-standard behaviour?

Anyhow:

<form ... onsubmit="hideMe(this);">

// Using a shift:
function hideMe(f)
{
f.style.position = 'absolute';
f.style.left = '-9000px';
}
// Using visibility:
function hideMe(f)
{
f.style.visibility = 'hidden';
}

--
Rob
Oct 4 '05 #8
RobG said the following on 10/3/2005 9:19 PM:
Randy Webb wrote:
charlie_M said the following on 10/3/2005 3:45 PM:
Can you nest DIVs??
Yes. What does that have to do with Javascript?
The problem and the reason I ask the original question... these pages
are written in Foxpro and there are literally hundreds of them. I am
loking for the easiest method to blank the screen when sublitted and
would favor the method that would allow trhe change be centrally
applied (like a form's onsubmit()).


If Foxpro is screwing your pages up that bad, you need a new editor.

<form onsubmit="hideTheBody()">

function hideTheBody(){
bodyNode = document.body?document.body:document.documentEleme nt;
bodyNode.innerHTML = '';
}

That doesn't work, by the time the submit runs, there is nothing left to
submit (or was that the intention?).


<g>

I get facetious at times :)
Try:

function hideTheBody()
{
bodyNode = document.body? document.body : document.documentElement;
if (bodyNode.style){
bodyNode.style.display = 'none';
}
}

However, it seems like a very bad idea - why not just write 'The form is
being submitted' or similar to the page in a faux message dialog?.


My personal preference is to let the user screw up. Nothing will teach
you quicker not to double-submit a form than trying to go through email
tech (or the phone) to try to get your money back after making that
screw up.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?
Oct 4 '05 #9
Randy Webb wrote:
RobG said the following on 10/3/2005 9:19 PM:
Randy Webb wrote:
[...]

If Foxpro is screwing your pages up that bad, you need a new editor.

<form onsubmit="hideTheBody()">

function hideTheBody(){
bodyNode = document.body?document.body:document.documentEleme nt;
bodyNode.innerHTML = '';
}


That doesn't work, by the time the submit runs, there is nothing left
to submit (or was that the intention?).

<g>

I get facetious at times :)


The 'Foxpro as an editor' bit was something of a giveaway! ;-)

[...]
However, it seems like a very bad idea - why not just write 'The form
is being submitted' or similar to the page in a faux message dialog?.

My personal preference is to let the user screw up. Nothing will teach
you quicker not to double-submit a form than trying to go through email
tech (or the phone) to try to get your money back after making that
screw up.


Yes. I thought issues with multiple submits were fixed years ago on the
server. Client-side scripting is bound to fail sufficiently often that
it can only be considered a convenience some of the time for some users
and certainly not a robust solution.

I get the feeling a course somewhere has a unit on multiple submission
and some of the students have decided to come here...
--
Rob
Oct 4 '05 #10

RobG wrote:
Try:

function hideTheBody()
{
bodyNode = document.body? document.body : document.documentElement;
if (bodyNode.style){
bodyNode.style.display = 'none';
}
}

OK.. this solution works for submit buttons. However... it does not
appear to hit the <form onsubmit"....> when the page is submitted by
some of the form's other elements... like 'onclick="submit()"' and
'onchange="submit()"'. Whats up with that??

As for the suggested solution "put up a faux message..." that might
work too. Can it be placed in the center of a screen and will it go
away when the new screen arrives without intervention??
Chas

Oct 4 '05 #11
charlie_M said the following on 10/4/2005 10:39 AM:
RobG wrote:

Try:

function hideTheBody()
{
bodyNode = document.body? document.body : document.documentElement;
if (bodyNode.style){
bodyNode.style.display = 'none';
}
}

OK.. this solution works for submit buttons. However... it does not
appear to hit the <form onsubmit"....> when the page is submitted by
some of the form's other elements... like 'onclick="submit()"' and
'onchange="submit()"'. Whats up with that??


What is up with that is that you are using the incorrect elements to
cause form submission.

formName.submit() does not fire the onsubmit event handler.
As for the suggested solution "put up a faux message..." that might
work too. Can it be placed in the center of a screen and will it go
away when the new screen arrives without intervention??


Try it and see.......

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Oct 4 '05 #12

Randy Webb wrote:
What is up with that is that you are using the incorrect elements to
cause form submission.

formName.submit() does not fire the onsubmit event handler.


That one fact is very disapointing. I feel I am not using 'incorrect'
elements but I am let down with the fact that they don't fire through
the form''s onsubmit. I wonder what the thinking was??? Why not?

I did put this solution in a global onsubmit handler.... but now I
guess I need to add the call to 'hideTheBox()' in each and every
'onclick=' and 'onchange=' phrase in-use on the application website....
Oh well ;o))

My thanks to everyone who tried to help me with this.

Chas

Oct 4 '05 #13
charlie_M said the following on 10/4/2005 3:02 PM:
Randy Webb wrote:
What is up with that is that you are using the incorrect elements to
cause form submission.

formName.submit() does not fire the onsubmit event handler.
That one fact is very disapointing. I feel I am not using 'incorrect'
elements but I am let down with the fact that they don't fire through
the form''s onsubmit. I wonder what the thinking was??? Why not?


The only element in HTML whose purpose is to submit a form is an <input
type="submit">. Anything else that is used to submit or cause a form to
be submitted is incorrect use of the element. Form elements have
intended uses and to use them for anything else is incorrect usage.
I did put this solution in a global onsubmit handler.... but now I
guess I need to add the call to 'hideTheBox()' in each and every
'onclick=' and 'onchange=' phrase in-use on the application website....
Oh well ;o))


How does your form get submitted if JS is disabled? And, if your users
are too lazy to click a Submit button, how would they ever conjure up
the energy to click it twice?

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Oct 4 '05 #14

Randy Webb wrote:
The only element in HTML whose purpose is to submit a form is an <input
type="submit">. Anything else that is used to submit or cause a form to
be submitted is incorrect use of the element. Form elements have
intended uses and to use them for anything else is incorrect usage.
Thanks for clearing that up... but I would have hoped that js's
submit() would have tried to emulate this behavior?!?
How does your form get submitted if JS is disabled? And, if your users
are too lazy to click a Submit button, how would they ever conjure up
the energy to click it twice?

This is a monsterous application for clients. We (IT) get to specify
browser(s) and feature(s) in order to serve their purposes. JS=true is
just one of the specs.

As for the lazy users.. typically they double-click an element and the
way the system accesses the massive files it deals with .... it takes
sometimes 2-3 seconds to respond to a query... and the system races to
catch the subsequent clicks and bypass them. A great many of the pages
do not even have a submit button......... action taking place onclick
and onchange.

Chas

Oct 5 '05 #15

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

Similar topics

5
by: John | last post by:
Hey everyone, I keep getting multiple blank records entered along with my data everytime I submit my form. On the first page is the form itself without any code. On the 2nd page that it goes...
7
by: John | last post by:
How do I prevent blank data from being entered into a table? For instance, the user fills out a form, but if a field is left blank, then the entire entry won't be filled in. This isn't...
2
by: www | last post by:
Hi there, I' m getting a (0x80040E2F) error, if I submit my form, with blank textboxes to my update stored procedure. The stored procedure expect values, so how can I detect if a form field was...
5
by: Tim Johnson | last post by:
Howdy: I'm just learning how to use focus() and select(). I have a very large form (360+ elements). Javascript validation is launched by the 'onclick' event handler in the "submit" button tag....
1
by: Dave | last post by:
Hi All I'm new to php and am converting a bunch of asp pages to php. Current problem : I am using a Submit button on a form to POST ( send the database variables ) to a php page that will...
2
by: Eric | last post by:
We have a page that displays a datagrid with quite a bit of data in it. We have a few comb-boxes that we filter data on when we click the search button. I can change the combo-boxes and click the...
2
by: lmlaster | last post by:
I have 2 webs under my default web running win2003 1. A front-page intranet 2. A asp (not .net) web is fine Both allow anonomous access. My front page web always gets a BLANK...
1
by: Raul Elms | last post by:
Hi, I'm running Apache2 together with the php and mysql modules on an opensuse 10.1 machine. Most scripts run well, I can connect and query databases without any problems. But some well known...
10
by: Lorie0114 | last post by:
Hello, We have an issue that I do not know how to resolve. Our website has several hundred reports. There are a handful of them that are causing issues when there is no interaction for a couple...
4
by: koager | last post by:
I know there have been various questions about blank screens from php but I've looked around and they aren't helping me at all. I wrote a .php page and put it up on the hosting server but the page...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
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...
0
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...
0
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,...
0
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...

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.