Web Analytics Made Easy -
StatCounter Changing form action for mozilla - CodingForum

Announcement

Collapse
No announcement yet.

Changing form action for mozilla

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Changing form action for mozilla

    Hey

    Im building a CMS system for myself and a client at the moment, im using a popup window in the design of a MS config window like in outlook express so that my client will feel familiar with the interface (They are 55 i believe)

    anyways, I plan to use this same system on my small blog/diary site so I want it to be able to work in mozilla aswell. Im assuming they are using IE but it is possible that they listened when I mentioned mozilla.

    So, I have:

    <form action="3.php" method="post">

    as my form.

    When the user clicks the "back" button, the form action needs to be changed to 1.php so that all the current data that has been enter is still saved on each page.

    The JS i am using works in IE, and is:

    Code:
    <div class="button1">
       <input onclick="chaction()" type="image" name="Back" title="Back a Step" src="../source/images/back.gif" alt="Back Button" />
    </div>
    <div class="button2">
       <input onclick="justincase()" type="image" name="Submit" title="Next Step" src="../source/images/next-disabled.gif" alt="Next Button" />
    </div>
    
    
    And the script is:
    
    
    function chaction(){
          document.getElementById('docForm').action = '1.php';
    }
    
    // Just in case they click back and then next
    function justincase(){
          document.getElementById('docForm').action = '3.php';
    }
    Anyone have any ideas how I could do this, or if there is a way without using JS? (Remember that in terms of code the back button must come before the next button so I havn't yet been able to work out a non JS version becuase a form within a form doesnt seem to work)

    Thanks
    Matt
    PHP Weekly - A PHP Developers Resource
    PHP 5.1.4 and Ruby on Rails web hosting
    Moderator of PHP and Work offers and Requests
    Install Apache/PHP/MySQL
    (by marek_mar) | TinyPlugin Architecture

  • #2
    No worries, I have found a much easier way... Well It was late!

    Just in case this will help someone else, What I did is now all PHP based, basically, I have a page "go.php" that will read an action (eg: go.php?action=1) and then load the corresponding page with all post data intact. Much simpler, and it works fine.
    PHP Weekly - A PHP Developers Resource
    PHP 5.1.4 and Ruby on Rails web hosting
    Moderator of PHP and Work offers and Requests
    Install Apache/PHP/MySQL
    (by marek_mar) | TinyPlugin Architecture

    Comment

    Working...
    X