[Javascript] Form action

Chris Tifer christ at saeweb.com
Tue Nov 11 15:21:57 CST 2003


I don't believe there's any problem with changing the action dynamically.
I'm pretty sure that ability has been around for quite a while and is
implemented in many different browser versions.  You may want to
double-check that somewhere or wait for another response though ;)

Chris Tifer

----- Original Message ----- 
From: "Mike Dougherty" <mdougherty at pbp.com>
To: "[JavaScript List]" <javascript at LaTech.edu>
Sent: Tuesday, November 11, 2003 4:13 PM
Subject: [Javascript] Form action


Is it findamentally bad behavior to change a form's "action" property?

Ex:  Crystal RAS creates a form that posts to itself, assuming that the
page will make another request for the form to be processed/repainted.
For whatever reason, the querystring parameters are not included in the
action URL.  So in order to maintain the correct page context, I've
appended some 'fixer' code after the call to the report object:

Response.write("<script type='text/javascript'>")
Response.write("document.CrystalViewerCrystalForm.action='/main.asp?" &
Request.QueryString & "'" )
Response.write("</script>")

Now the page works the way it is supposed to, and I don't think I'm
incurring too much performance penalty by rewriting the action property
on the fly - but I was wondering what other javascript developers
thought about this tactic....



_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript




More information about the Javascript mailing list