Click to See Complete Forum and Search --> : passing the URL in a parameter on the form ACTION event for SUBMIT button..


cakeday
09-29-2003, 02:03 PM
I know how the form SUBMIT button works, when you hardcode the URL on the onclick event of the FORM..

But what i want to do here is, when the submit button is clicked, i want to pass the URL in a variable for object oriented purposes..

Is this possible, and if yes, HOW??

In the code below,
v_psppagename is the variable local to the page. And i fetch the data in the v_psppagename from a SELECT statement, which fetches the value from the database..

A part of my code looks like,

<form name="f3" method="GET" action= "v_psppagename">

<input type="submit" value="Submit" onClick="get_values();">
<input type="hidden" name="i_startdate">
<input type="hidden" name="i_enddate">
<input type="hidden" name="i_lob">
</td>
</form>


Everything else works the way it should, the form passes the parameters the way it should.. but when it SUBMITs the page the webpage address right now looks like,
http://159.225.218.59/pls/portal30/v_psppagename?i_startdate=1-Jan-2003&i_enddate=1-Jul-2003&i_lob=6

instead of
http://159.225.218.59/pls/portal30/showwebpage?i_startdate=1-Jan-2003&i_enddate=1-Jul-2003&i_lob=6

showwebpage is the value that is being captured in the v_psppagename variable from the database.

Thank you.

cakeday
09-29-2003, 06:18 PM
Can someone please tell me, if this is even possible..?

David Harrison
10-01-2003, 07:34 AM
You can get the value from the action attirbute and pass it to a hidden input field, like this:

document.f3.action_url.value=document.f3.getAttribute("action");

I'm pretty sure that this will work but I have only ever getAttribute with forms that have id's.