Results 1 to 5 of 5
  1. #1

    simple js question, special submit forms

    i want to be able to call a submit form function to submit any form on the page
    i have it like this, but it doesnt work:

    function submitlogin(formname){
    document.formname.submit();
    }

    and i pass everything right i know that. just document.formname.submit does not seem to want to work.

    thanks, im sure it is easy, i just was never any good at js. i am a php fan.
    workstations&servers @
    http://www.advancedproprietarysystems.com

  2. #2
    Join Date
    May 2005
    Location
    Planet Earth
    Posts
    813
    try:


    eval("document.forms['"+formname+"'].submit();");
    PutFile.io Disrupting traditional file hosting.
    █ Signup Early and enjoy Unlimited space/bandwidth for your files hosting, Forever!
    █ No Ads.
    █ No Countdowns.

  3. #3
    awesome!! works perfect thanks. now i will figure out how it works and it to my miniscule knowledge of js.

    thanks again!
    workstations&servers @
    http://www.advancedproprietarysystems.com

  4. #4
    you were passing a string where your function expects a form object.

    eval just evaluates the string as a variable name

  5. #5
    oh, ok thanks, ic
    workstations&servers @
    http://www.advancedproprietarysystems.com

Posting Permissions

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