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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

JavaScript

  • 16-04-2009 1: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,035 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