Results 1 to 3 of 3

Thread: Submit Form With JavaScript

  1. #1

    Question Submit Form With JavaScript

    I want to submit a form using JavaScript. Basically I need to do some pre-processing when the user clicks the Submit button to assure that all the necessary fields are filled out BEFORE I allow the form to actually be submitted. I found that I can do the actual submit in JavaScript with something like:

    Code:
    document.LAYOUTFORM.submit();
    where LAYOUTFORM is the ID of the form.

    In NetObjects, when you declare a page as a form it automatically names it LAYOUTFORM. But that's the NAME of the form, not its ID. It seems that there's no way to give the LAYOUT form an ID. I tried defining a table as a form (and putting all my controls inside it) and although it does cause <FORM> tags to be created around the table, again it does not provide a means of giving the form an ID.

    So how do I do this? How can I specify an ID for the <FORM> tag? Or otherwise cause the page to be submitted properly?

  2. #2
    Senior Member gotFusion's Avatar
    Join Date
    Jan 2010
    Location
    www.gotHosting.biz
    Posts
    4,529

    Default

    you can include your ID within your form action after the action. like this:

    /folder/file.ext" id="whatever

    You will notice that the action URL has a closing quote and the last quote is left off. Fusion will add this when it writes your action to the form tag
    NetObjects Fusion Cloud Linux enabled Web Hosting, support + training starts at $14.95
    NetObjects Fusion web Hosting and support + ASP + PHP + ColdFusion + MySQL + MS SQL
    FREE NetObjects Fusion Support & training comes with all web hosting accounts
    NetObjects Fusion Web Hosting: http://www.gotHosting.biz

  3. #3
    Twayne
    Guest

    Default Re: Submit Form With JavaScript

    In news:RogerInHawaii.4pl7vb@no-mx.forums.netobjects.com,
    RogerInHawaii <RogerInHawaii.4pl7vb@no-mx.forums.netobjects.com> typed:
    :: I want to submit a form using JavaScript. Basically I need
    :: to do some pre-processing when the user clicks the Submit
    :: button to assure that all the necessary fields are filled
    :: out BEFORE I allow the form to actually be submitted. I
    :: found that I can do the actual submit in JavaScript with
    :: something like:

    What about the people who don't use or allow javascripts to run? There are
    more of them than one might suspect according to my own site stats.

    Twayne`


    ::
    ::
    :: Code:
    :: --------------------
    :: document.LAYOUTFORM.submit();
    :: --------------------
    ::
    ::
    :: where LAYOUTFORM is the ID of the form.
    ::
    :: In NetObjects, when you declare a page as a form it
    :: automatically names it LAYOUTFORM. But that's the NAME of
    :: the form, not its ID. It seems that there's no way to give
    :: the LAYOUT form an ID. I tried defining a table as a form
    :: (and putting all my controls inside it) and although it
    :: does cause <FORM> tags to be created around the table,
    :: again it does not provide a means of giving the form an
    :: ID.
    ::
    :: So how do I do this? How can I specify an ID for the
    :: <FORM> tag? Or otherwise cause the page to be submitted
    :: properly?




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •