PRB: Problem Setting document.action

Last reviewed: May 29, 1997
Article ID: Q164497
The information in this article applies to:
  • Microsoft Visual Basic, Scripting Edition, versions 1.0, 1.1, 2.0

SYMPTOMS

When performing client-side processing using JScript or VBScript, it might be desirable to select a document.action based on information provided by the user. Setting the action property of the document using either VBScript or JScript does not result in the new value being called when the form is submitted. Instead the original value is still used.

RESOLUTION

All form processing must done within the same Action target.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Behavior

The following page exhibits this behavior. The page contains a form with an Action. When the "Change" button is pressed, a JScript is run that attempts to alter the Action of the form. When the form is submitted it accesses the URL http://example.microsoft.com instead of the URL that the action was changed to.

   <HTML>
   <HEAD>
   <TITLE>Submit() Example</TITLE>
   <SCRIPT LANGUAGE="JavaScript">
   <!--
   function change( ) {
      document.test.action="http://www.microsoft.com";
      alert("Form.action was changed to " + document.test.action);
      document.test.submit();
   }
   // -->
   </SCRIPT>
   </HEAD>
   <BODY>
   <FORM NAME="test" METHOD=POST ACTION="http://example.microsoft.com"
   onSubmit="alert(test.action); >
   The Form.Action is set to "http://example.microsoft.com". Click submit
   to call example.microsoft.com or click change to change to Action
   property to microsoft.com.
   <BR><BR>
   <INPUT TYPE="Button" VALUE="Change" onClick="change();">
   <INPUT TYPE="Submit">
   </FORM>
   </BODY>
   </HTML>
 

	
	


Keywords : kbprg vbObjMdlIE kbprb
Version : 1.00 1.10 2.00
Platform : WINDOWS
Issue type : kbprb


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: May 29, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.