Community Forums 

Main Content

Form submission on 'page load'

    May 10 2012 16:45:04

    #1

    LazyCarrot

    Join date : 2009-06-26      Posts : 52

    Is it possible to automatically submit a form (ie write to the shopping cart) when the user arrives at a page, without them having to click a submit button.

    essentially i'm looking to replace the line: <input type="submit" ... > with something that will submit the form on 'page load'.

    can't find any html type reference that will let me do this... anyone have any ideas?



    May 11 2012 05:45:18

    #2

    GT

    Join date : 2008-09-18      Posts : 3207

    I've placed a script at the top of the head area, you'll need to copy that, plus give your form an id value:

    http://www.malsforms.com/send-on-page-load.html

    Having trouble with a form or need one building?
    Fast turnaround, but I do charge :)

    Mal's Forms / Scripts and the syntax are here.




    May 12 2012 14:43:45

    #3

    anon

    Join date : 2008-09-18      Posts : 488

    You can do a redirect and submit a url to the cart. That way you don't have to rely on any javascript.



    May 13 2012 09:07:30

    #4

    LazyCarrot

    Join date : 2009-06-26      Posts : 52

    Thanks for the replies...

    GT - Coding works great!... installed and running live.

    anon - Thanks for your suggestion, havn't tried it out but i'll bear that one in mind if i need something similar.