Cool. Thanks Simon.
Einar
>Hi Einar
>
>In one of my web apps I use a data driven menu shown below:
>
><form action="" name="MenuForm" method="POST"
> enctype="application/x-www-form-urlencoded">
>
> <select name="lstMenu" class="navList" style="width: 150"
> onfocus="window.status='Select the faculty web planner link
> from the drop down list.';"
> onchange="ExecuteMenuItem(this.value);">
>
> <Option value="wc.dll?WPProcess~ShowPage~WPFacultyWebPage">
> Main Menu</Option>
> < %= Process.LoadMenu() </select>
></form>
>
>function ExecuteMenuItem(lcUrl)
> { document.MenuForm.action='wc.dll?'+lcUrl;
> document.MenuForm.submit();
> }
>
>
>When you select an item in the dropdown list it changes the form action and
>submits the form.
>
>Simon
>
>
>>Thanks for the reply Simon. Could you please send me sample code?
>>Einar
>>>Hi
>>>
>>>Yes I believe so because I often use a Select control to change the form action so I assume you can do the same with a button. You simply set the action property to what you want in the onclick event of the button.
>>>
>>>Simon
>>>
>>>
>>>>Considder the following html-code (from activeVFP demo)
>>>>
>>>><form method="POST" action="/avfpdemo2/Default.asp?action=vfpscript">
>>>><input type="text" name="txtCompany" value="" size="20">
>>>><input type="Submit" value=" Get Customers">
>>>></form>
>>>>
>>>>On submit the page calls itself, but this time oRequest.Form("txtCompany") is not .null. it is whatever you typed into the textbox. This is great and it works good.
>>>>My question is: Is there a way to change the action string to something else when the submitt button is pressed?
>>>>Lets say I entered: EINAR into the textbox and his submit. Is there a way that the page would redirect me to:
>>>>
>>>>/avfpdemo2/Default.asp?action=vfpscript&company=EINAR"
>>>>
>>>>
>>>>This would be like passing a parameter to the next page instead of grabing a parameter from the previous page.
>>>>
>>>>Does this make any sense? Is it better to grab the value from the previous page?
>>>>I assume some javascript code would be nessesary to accomplish what I want. Has anyone ever done anything like this before?
>>>>
>>>>Einar
Semper ubi sub ubi.