Forcing 'Submit'

I

Ike

How can I force a submit in a form, without having to have the user click on
a button, or take any action whatsoever.

I have a form, which checks a password against a database (all using php),
and then submits the form (which now includes an authorization level for the
person accessing the page) .....all of this is supposed to happen
transparently to the user such that they do not have to hit a button or do
anything.

So how can I submit a form withOUT having the user hit a button or do
anything? Can I?

Thanks, Ike
 
R

Ryan Stewart

Ike said:
How can I force a submit in a form, without having to have the user click on
a button, or take any action whatsoever.

I have a form, which checks a password against a database (all using php),
and then submits the form (which now includes an authorization level for the
person accessing the page) .....all of this is supposed to happen
transparently to the user such that they do not have to hit a button or do
anything.

So how can I submit a form withOUT having the user hit a button or do
anything? Can I?

Thanks, Ike
If memory serves:

<form name="aForm" action="somePage.html">
</form>
<script type="text/javascript">
<!--
document.aForm.submit();
-->
</script>
 
J

Jukka K. Korpela

Ryan Stewart said:
- -
document.aForm.submit();

Exactly how do you plan to force the user's browser execute JavaScript
code? Thank &Deity;, you cannot.

The correct answer to the original question is: you cannot, and you
could do quite some harm in trying to achieve it. The original question
was strangely formulated - how could a _form_ do something? It's just
data. Forms are not supposed to do anything. The user is supposed to
submit a form by using a submit button. Maybe the question was about
automating something that happens after that.
 
R

Ryan Stewart

Jukka K. Korpela said:
Exactly how do you plan to force the user's browser execute JavaScript
code? Thank &Deity;, you cannot.

The correct answer to the original question is: you cannot, and you
could do quite some harm in trying to achieve it. The original question
was strangely formulated - how could a _form_ do something? It's just
data. Forms are not supposed to do anything. The user is supposed to
submit a form by using a submit button. Maybe the question was about
automating something that happens after that.
I was just answering his question. You can't force a client browser to do
anything, but if JavaScript is enabled, what I gave him will work. As for
why he wants to do it, that's a good question. As to what forms are and are
not supposed to do, it seems to me that everything HTMLish today is doing
stuff that HTML was not originally designed to do.
 
H

Hywel Jenkins

How can I force a submit in a form, without having to have the user click on
a button, or take any action whatsoever.

I have a form, which checks a password against a database (all using php),
and then submits the form (which now includes an authorization level for the
person accessing the page) .....all of this is supposed to happen
transparently to the user such that they do not have to hit a button or do
anything.

So how can I submit a form withOUT having the user hit a button or do
anything? Can I?

How does the user enter their password if it happens transparently?
 
A

Augustus

Ike said:
How can I force a submit in a form, without having to have the user click on
a button, or take any action whatsoever.

I have a form, which checks a password against a database (all using php),
and then submits the form (which now includes an authorization level for the
person accessing the page) .....all of this is supposed to happen
transparently to the user such that they do not have to hit a button or do
anything.

So how can I submit a form withOUT having the user hit a button or do
anything? Can I?

Maybe you should explain in detail what it is you want to do (as compared to
what you are doing).

The way you described your problem, I think there is something you want to
do, but maybe because you aren't very experienced in PHP and server side
programming you are doing what you can and know how to do, but it might not
be the best possible solution to your problem (and due to needing scripting,
won't work for all users)... so if you gave a more detailed explanation of
what you want to do, people could maybe offer tips and suggestions or links
to sites that accomplish what you want.
 
B

Bob

Exactly how do you plan to force the user's browser execute JavaScript
code? Thank &Deity;, you cannot.

It will work for the large majority of users. Most users use a JS
supportive browser and do not shut it off. No JS support is the
exception, not the rule.
The correct answer to the original question is: you cannot, and you
could do quite some harm in trying to achieve it.

What harm is he going to do ?
The original question
was strangely formulated - how could a _form_ do something? It's just
data. Forms are not supposed to do anything. The user is supposed to
submit a form by using a submit button. Maybe the question was about
automating something that happens after that.

Reread the post. He wants to log them into his system. After that
he's obviously going to provide access or filter the content in
some way. Same old, same old.

The whole thing sounds like a poor idea to me, but I've heard it
asked for a hundred times before.
 
J

Jukka K. Korpela

Bob said:
It will work for the large majority of users.

Maybe. That does not mean it can be forced.
What harm is he going to do ?

Who knows? We don't know what's going on - we can just make guesses.
Reread the post.

No need to. It does not become any clearer that way.
He wants to log them into his system.

The question remains what that means. Logging in is not an HTML
concept, and could mean lots of things. In normal server-level password
protection, no HTML form is needed, still less any automatic form
submission.
 
B

Bob

Maybe. That does not mean it can be forced.

Correct. But you can cause 99.99% of the users to do it :)
Who knows? We don't know what's going on - we can just make guesses.

My point is that the worst that can happen is that he is not
going to get the results he wants at his web site. He's not going
to harm anyone with JS unless he's using it to launch WMD's.
No need to. It does not become any clearer that way.

The question remains what that means. Logging in is not an HTML
concept, and could mean lots of things. In normal server-level password
protection, no HTML form is needed, still less any automatic form
submission.

Server level password protection is not suitable for application use.
Validating the user via an HTML form is a normal application
function.

I agree that an automatic form submission is not a good idea.
 
W

Whitecrest

Yes, that's the correct answer.

Sure you can. You just can not guarantee if it will work on 100% of your
visitors. About 85% or more will either turn it on, or it will work
because they have javascript on by default.

Those that it doesn't work for will have a decision to make.

You have a decision to make. Will the 85% sustain you? If it will,
then go for it. If it won't (if you need every stinking person you can
get top buy something) then you might want to think about using it or
not.
 
J

Jukka K. Korpela

Whitecrest said:
Sure you can. You just can not guarantee if it will work on 100% of
your visitors.

So your definition of "force" means that something forced may not
actually be forced. This sounds somewhat similar to a famous history
that revolved around the definition of "sex".

If "force" does not mean forcing, I'm willing to admit that you can
force virtually anything. I will now force you to send each of us
$1,000,000. (No, you won't need our contact information - after all,
I'm just "forcing" you.)
 
R

Ryan Stewart

Jukka K. Korpela said:
So your definition of "force" means that something forced may not
actually be forced. This sounds somewhat similar to a famous history
that revolved around the definition of "sex".

If "force" does not mean forcing, I'm willing to admit that you can
force virtually anything. I will now force you to send each of us
$1,000,000. (No, you won't need our contact information - after all,
I'm just "forcing" you.)

Look, the point is he wanted to know how to submit a form without a Submit
button. Now he knows. Whether what he is doing is a good idea or not is
beyond the scope of his original question. If he would give more detail
about what he's trying to do, I'm sure plenty of people (yourself included)
would pipe up with why he shouldn't do it that way and possibly give him a
better method.
 
J

Jukka K. Korpela

Ryan Stewart said:
Look, the point is he wanted to know how to submit a form without a
Submit button.

As the Subject line says, he wanted to know how to _force_ 'Submit'.
Now he knows.

No, he doesn't, that should be apparent.
 
W

William Tasso

Ryan said:
...Whether what he is doing is a good idea
or not is beyond the scope of his original question.

LOL: Welcome to usenet.

Please note that the support desk is just down the hall, second door on your
right. Have your charge-card ready. They are armed with a large supply of
answers that have been vetted by the internet police and are designed to
give the o/p exactly the required level of warm-fuzzy.

However the o/p has chosen the alt.html door where the content of any
on-topic post (and some others too) is open for discussion. If that
discussion should reveal a usable answer for the o/p then that is indeed a
bonus.

In the mean-time, if you have any concerns with the way this group is
managed, please direct your comments to the internet engineering authority -
usenet division. There should be a branch meeting every week in your
locale - if not then please organise one immediately as regulations dictate
that there is adequate representation from all interested parties. Failure
to comply will result in the withdrawal of internet access facilities.

Happy new year to one and all.
 
W

Whitecrest

So your definition of "force" means that something forced may not
actually be forced....

My definition of forced is based on the general set up of 85% of the
worlds users.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top