Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: form wont post

  1. #1
    Regular Coder
    Join Date
    Sep 2007
    Location
    Grahamstown, South Africa
    Posts
    237
    Thanks
    6
    Thanked 17 Times in 17 Posts

    form wont post

    Any idea why it wont post?

    Code:
    function submitForm(){
    	document.all.edit_student.submit();
    }
    THE FORM STUFF:

    Code:
    <form name="edit_student" action="edit-student.php?sid=<?php echo($sid); ?>" method="post" enctype="multipart/form-data">
    THE BUTTON THAT FAILS:

    Code:
    <a href="#" onClick="javascript: submitForm();">Quick Edit</a>
    Sorry about poorly written message, just in a hurry to get home and this little glitch is agonizing!!

  • #2
    Senior Coder shyam's Avatar
    Join Date
    Jul 2005
    Posts
    1,563
    Thanks
    2
    Thanked 163 Times in 160 Posts
    try using
    Code:
    function submitForm(){
    	document.edit_student.submit();
    }
    <a href="#" onClick="submitForm()">Quick Edit</a>
    You never have to change anything you got up in the middle of the night to write. -- Saul Bellow

  • #3
    Regular Coder
    Join Date
    Sep 2007
    Location
    Grahamstown, South Africa
    Posts
    237
    Thanks
    6
    Thanked 17 Times in 17 Posts
    Doesnt work either.... tried a whole host of different functions... Just refuses to post, im at my wits end.

  • #4
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,863
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    You probably have an input element having name="submit". If so, you'd need to rename it it and make all necessary changes in your other parts of your code.
    Though, I'd recommend the use of an input element having type="submit" instead of an anchor and a javascript code to submit your form. (Then you could adopt some Progressive Enhancement)
    Last edited by abduraooft; 01-21-2009 at 08:44 AM.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    idalatob (01-21-2009)

  • #5
    Regular Coder
    Join Date
    Sep 2007
    Location
    Grahamstown, South Africa
    Posts
    237
    Thanks
    6
    Thanked 17 Times in 17 Posts
    Thanks abdura.

    I had a form with: <input type="submit" name="submit">

    It is a long form so I just wanted the user to have an opportunity to submit at various stages of form completion.

  • #6
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,863
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    It is a long form so I just wanted the user to have an opportunity to submit at various stages of form completion.
    So what? Couldn't you just duplicate your submit button, wherever required?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

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