Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

JavaScript

  • 16-04-2009 02:36AM
    #1
    Registered Users, Registered Users 2 Posts: 13,746 ✭✭✭✭


    Can someone tell me what the following commands do:

    function autoSubmit()
    formObject.submit()
    onChange

    I cant seem to find a decent explanation on the net.


Comments

  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes




  • Registered Users, Registered Users 2 Posts: 1,127 ✭✭✭smcelhinney


    autoSubmit() sounds like a custom function. Form.submit()... Hmmm, what could that be? javascript form submit action maybe?

    onChange is an event.

    As per hobbes post, u probably need to start at the start my good man...


  • Moderators, Science, Health & Environment Moderators Posts: 9,206 Mod ✭✭✭✭mewso


    function autoSubmit()

    The correct way to declare a function called autoSubmit. It's just missing curly braces:

    function autoSubmit() {

    }

    It also uses javascript convention properly too where the function name should begin with a lower case letter and only objects should begin with a capital letter.

    formObject.submit()

    Assuming formObject is a correct reference to a form element on a page this will submit the form.

    onChange

    An event commonly associated with an input field which occurs when a user changes the contents of the input. Most proper implementations would not use the capital C. e.g.

    var firstname = document.getElementById("firstname");
    firstname.onchange = function() {
    window.status = "name changing!";
    };


Advertisement