Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

JavaScript

Options
  • 16-04-2009 2:36am
    #1
    Registered Users 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 Posts: 21,264 ✭✭✭✭Hobbes




  • Registered Users 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: 8,954 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