Results 1 to 4 of 4

Thread: calling two functions from one form

  1. #1

    Thread Starter
    Fanatic Member davebat's Avatar
    Join Date
    Dec 2002
    Posts
    727

    calling two functions from one form

    Ive got two seperate form validation functions, they work seperatety fine, but i need to call both on the onsubmit of the form. ive tried but only the first function seems to be called.

    onSubmit="return (Remove(q12,q14)&&ValidateForm(F_C_DAY.value,F_C_MONTH.value,F_C_YEAR.value));"


    can anybody help please?

  2. #2

    Thread Starter
    Fanatic Member davebat's Avatar
    Join Date
    Dec 2002
    Posts
    727
    I cheated and called one of the functions from the onclick event of the button

  3. #3
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877
    Why not call the second validation function from the first one. Or write a new function that will call those two validation functions.

    Not sure if you use onclick event it will prevent the form from submiting if the validation returns false. have to check on that. But personally i would prefer the method i have mentioned earlier.

    Danial
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  4. #4

    Thread Starter
    Fanatic Member davebat's Avatar
    Join Date
    Dec 2002
    Posts
    727
    Ideally that is what I would have done Danial but I copied the functions from elewhere and after a load of tinkering got them working for me. Im not a javascript expert and havent got the time to combine them. good suggestion though.

    A return false on an onclick event will stop the form submission so this is an alright way to do it.

Posting Permissions

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



Click Here to Expand Forum to Full Width