Results 1 to 6 of 6

Thread: [RESOLVED] stupid javascript form.submit() problem

Threaded View

  1. #1

    Thread Starter
    Addicted Member Sibby's Avatar
    Join Date
    Feb 2001
    Location
    Milwaukee, WI *The United States of America*
    Posts
    144

    [RESOLVED] stupid javascript form.submit() problem

    ok, I have a link calling a javascript function

    Code:
    <a href=updateuser.aspx?id=123 onclick=submitAction(10)>save</a>
    then I have a function defined that changes a value of a hidden form element

    Code:
    <script language="javascript">
       function submitAction(val) {
           document.myform.action.value = val;
           document.myform.submit();
       }
    </script>
    pretty damn simple so far right.....ok, well the link is clicked, in the Page_Load sub, I check the value of request.form("action") and attempt to take the appropriate action. When I check it the value is equal to NOTHING, which means the form never got submitted!! Now here's the kicker....when I put a meaningless alert box (see below) it works just fine!!?!?

    Code:
       function submitAction(val) {
           document.myform.action.value = val;
           document.myform.submit();
           alert('garbage');
       }
    I am at my wits end....can someone see what stupid thing I am doing wrong?
    Last edited by Sibby; Dec 6th, 2004 at 11:06 AM.
    If you can think it....you can code 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