[Javascript] Form action

Mike Dougherty mdougherty at pbp.com
Tue Nov 11 15:13:12 CST 2003


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....






More information about the Javascript mailing list