[Javascript] Form action
Mike Dougherty
mdougherty at pbp.com
Tue Nov 11 15:31:34 CST 2003
My main.asp page instantiates a bunch of objects, then calls an object
method which renders the HTML to support the report - so I'd really have
to go digging to alter the native behavior of the form's action or
onSubmit.
In this shop, it's the path of least resistance to make a solution work.
I only pause to question if there's a better way for the sake of the
future - the "right way" usually has less negative implications for
future change/development
-----Original Message-----
From: javascript-bounces at LaTech.edu
[mailto:javascript-bounces at LaTech.edu] On Behalf Of Andrew Gibson
Sent: Tuesday, November 11, 2003 4:29 PM
To: [JavaScript List]
Subject: Re: [Javascript] Form action
I can't see any great problem in doing this, and if its the only
way....?
Could you put the querystring in the form tag - though obviously I don't
know your overall logic
<form action='/main.asp?<%=request.querystring()%>' >
or even in a onSubmit function
function submitMe()
{
document.CrystalViewerCrystalForm.action='/main.asp?<%=request.querystri
ng()
%>'
}
Andrew
=====================================================
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