Solved

Form Action = textbox value

Posted on 2003-11-13
3
624 Views
Last Modified: 2006-11-17
Okay. Here's what I need

I want to have a javascript form, whose action is the value of an input box on a seperate form

Ex: I type in http://www.database.com/SendFormToHere.php in an input box on that page, and the action of my other form is http://www.database.com/ yatta yatta yatta

What'd be the code for this?
0
Comment
Question by:TrentSilverleaf
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
ho_alan earned 60 total points
ID: 9744439
<script>
function submitForm()
{
       document.fm1.action = document.fm1.fmAction.value
       document.fm1.submit();
}
</script>

<form name=fm1 method=post>
<input type=text name=fmAction value="youraction.php">
<input type=button value=submit onclick="submitForm()">
</form>

see if it helps
0
 

Author Comment

by:TrentSilverleaf
ID: 9744482
Aye...

*Smacks self on forehead*

Why the hell didn't I think of that?

Anyway, thank you. Points for you
0
 
LVL 5

Expert Comment

by:ho_alan
ID: 9744510
thx, u're welcome :-)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (http://www.experts-exchange.com/A_3488.html), typical array handling might look like this: (CODE) B…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now