Forcing 'Submit'

Discussion in 'HTML' started by Ike, Dec 26, 2003.

  1. Ike

    Ike Guest

    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
    Ike, Dec 26, 2003
    #1
    1. Advertising

  2. Ike

    Ryan Stewart Guest

    "Ike" <> wrote in message
    news:ZhYGb.1602$...
    > 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>
    Ryan Stewart, Dec 26, 2003
    #2
    1. Advertising

  3. "Ryan Stewart" <> wrote:

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

    - -
    > 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.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    Jukka K. Korpela, Dec 26, 2003
    #3
  4. Ike

    Ryan Stewart Guest

    "Jukka K. Korpela" <> wrote in message
    news:Xns945DC00B78AC6jkorpelacstutfi@193.229.0.31...
    > "Ryan Stewart" <> wrote:
    >
    > >> How can I force a submit in a form, without having to have the
    > >> user click on a button, or take any action whatsoever.

    > - -
    > > 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.
    >
    > --
    > Yucca, http://www.cs.tut.fi/~jkorpela/
    > Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    >

    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.
    Ryan Stewart, Dec 26, 2003
    #4
  5. In article <ZhYGb.1602$>,
    says...
    > 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?

    --
    Hywel I do not eat quiche
    http://hyweljenkins.co.uk/
    http://hyweljenkins.co.uk/mfaq.php
    Hywel Jenkins, Dec 26, 2003
    #5
  6. Ike

    Augustus Guest

    "Ike" <> wrote in message
    news:ZhYGb.1602$...
    > 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.
    Augustus, Dec 26, 2003
    #6
  7. Jukka K. Korpela, Dec 26, 2003
    #7
  8. Ike

    Bob Guest

    On Fri, 26 Dec 2003 16:52:44 +0000 (UTC), "Jukka K. Korpela"
    <> wrote:

    >"Ryan Stewart" <> wrote:
    >
    >>> How can I force a submit in a form, without having to have the
    >>> user click on a button, or take any action whatsoever.

    >- -
    >> document.aForm.submit();

    >
    >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.
    Bob, Dec 26, 2003
    #8
  9. Bob <> wrote:

    > 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.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    Jukka K. Korpela, Dec 26, 2003
    #9
  10. Ike

    Bob Guest

    On Fri, 26 Dec 2003 23:22:13 +0000 (UTC), "Jukka K. Korpela"
    <> wrote:


    >Maybe. That does not mean it can be forced.


    Correct. But you can cause 99.99% of the users to do it :)

    >> What harm is he going to do ?

    >
    >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.

    >> 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.


    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.
    Bob, Dec 26, 2003
    #10
  11. Bob wrote:
    > 99.99%


    Where on earth do you get your statistics?
    Leif K-Brooks, Dec 27, 2003
    #11
  12. Leif K-Brooks wrote:
    > Bob wrote:
    >> 99.99%


    > Where on earth do you get your statistics?


    87.93% of statistics are made up on the spt.

    --
    David Dorward <http://dorward.me.uk/>
    David Dorward, Dec 27, 2003
    #12
  13. Ike

    brucie Guest

    in post <news:bsiigt$4dd$1$>
    David Dorward said:

    >>> 99.99%


    >> Where on earth do you get your statistics?


    > 87.93% of statistics are made up on the spt.


    only 46.7% believe that

    --
    brucie
    27/December/2003 10:08:43 am kilo
    brucie, Dec 27, 2003
    #13
  14. Ike

    Whitecrest Guest

    In article <Xns945DECF769542jkorpelacstutfi@193.229.0.31>,
    says...
    > > You can't force

    > 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.

    --
    Whitecrest Entertainment
    www.whitecrestent.com
    Whitecrest, Dec 27, 2003
    #14
  15. Ike

    Whitecrest Guest

    In article <bsiigt$4dd$1$>,
    says...
    > Leif K-Brooks wrote:
    > >> 99.99%

    > > Where on earth do you get your statistics?

    > 87.93% of statistics are made up on the spt.


    I hears it was 87.54%

    --
    Whitecrest Entertainment
    www.whitecrestent.com
    Whitecrest, Dec 27, 2003
    #15
  16. Whitecrest <> wrote:

    >> > You can't force

    >> Yes, that's the correct answer.

    >
    > 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.)

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    Jukka K. Korpela, Dec 27, 2003
    #16
  17. Ike

    Ryan Stewart Guest

    "Jukka K. Korpela" <> wrote in message
    news:Xns945EA450218A4jkorpelacstutfi@193.229.0.31...
    > 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.
    Ryan Stewart, Dec 27, 2003
    #17
  18. Jukka K. Korpela, Dec 27, 2003
    #18
  19. Ryan Stewart wrote:
    > ...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.
    --
    William Tasso
    William Tasso, Dec 27, 2003
    #19
  20. Ike

    Whitecrest Guest

    In article <Xns945EA450218A4jkorpelacstutfi@193.229.0.31>,
    says...
    > >> > You can't force
    > >> Yes, that's the correct answer.

    > > 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....


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

    --
    Whitecrest Entertainment
    www.whitecrestent.com
    Whitecrest, Dec 28, 2003
    #20
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Rilling

    Re: forcing timed form submit from asp.net

    Peter Rilling, Feb 29, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    454
    Peter Rilling
    Feb 29, 2004
  2. Mark
    Replies:
    1
    Views:
    1,686
  3. Ghafran Abbas
    Replies:
    0
    Views:
    4,201
    Ghafran Abbas
    Oct 12, 2004
  4. The Crow
    Replies:
    2
    Views:
    4,367
    Bruce Barker
    Sep 27, 2005
  5. duane

    Forcing document to submit cookies

    duane, Sep 21, 2003, in forum: Javascript
    Replies:
    1
    Views:
    95
Loading...

Share This Page