SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Jun 2004
    Location
    UK
    Posts
    605
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Submit form on changing select box, but submit to different URL

    Hi,

    I've got a form on 'mypage.asp' with two select boxes. I need to post to 'mypage.asp' when these box values are changed, since they affect each other's values.

    However, when someone clicks the final 'submit' button, I need all of the form values to be posted to 'submit.asp'.

    Is this possible? If so, any help would be much appreciated, thanks!

  2. #2
    SitePoint Guru
    Join Date
    Jun 2004
    Location
    UK
    Posts
    605
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorted:

    Code:
    <script language=javascript>
    <!--
    function funPostFromSelect()
    {
    document.getElementById('level').action = "mypage.asp"
    document.getElementById('level').submit(); // Submit the page
    return true;
    }
    
    function funPostFromSubmit()
    {
    document.getElementById('level').action = submit.asp"
    document.getElementById('level').submit(); // Submit the page
    return true;
    }
    -->
    </script>


Bookmarks

Posting Permissions

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