Forum Moderators: open
I have this secondary ASP-generated HTML page which is included by other pages and in it a form is declared.
Seeing I don't know which parent page is including the secondary one -- unless I create a function accepting a string argument identifying the parent page -- I cannot define the ACTION parameter in the FORM tag.
I've tried not defining the ACTION param in IE 6 and it worked fine: whenever the form was submitted, the parent page was assumed as being the page to submit data to.
My question is: is it safe to do this? And what about other browsers? Does anyone know how they behave in this sort of situation?
Thank you.
Dave
Now, I'm not an ASP jockey - but it seems to me that you should be able to reference the specific page's url with many kinds of scripting and declare a variable to put the url into the action attribute. Once an include has been written into a page by the server and sent down to the client, then the information is there simply for the reading.
Maybe the folks in our ASP and .NET Forum [webmasterworld.com] could give you some input.
You can always download a few browsers and test out the "no action" approach, but when you use non-valid approaches, there's always the risk that it will break on the one you didn't test (like Safari or something), so I don't recommend that direction.
but it seems to me that you should be able to reference the specific page's url with many kinds of scripting and declare a variable to put the url into the action attribute
All the pages that make the website have their own unique page_id whose URL resides in a data source, so fetching the URL and including it where required is not a problem. Basically, I was intrigued as to whether the ACTION parameter is optional or not -- and how the browsers behave in this situation.
but when you use non-valid approaches, there's always the risk that it will break on the one you didn't test (like Safari or something), so I don't recommend that direction.
That is what I am afraid of... Anyway, and as you said, this is a non-valid approach and I am not willing to find out whether all the browsers make it valid.
Being a disciplined programmer (whose environment is not the Web), I'd rather stick to the standards.
Thank you very much for the insights.
Dave