• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 640
  • Last Modified:

Form Action = textbox value

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
TrentSilverleaf
Asked:
TrentSilverleaf
  • 2
1 Solution
 
ho_alanCommented:
<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
 
TrentSilverleafAuthor Commented:
Aye...

*Smacks self on forehead*

Why the hell didn't I think of that?

Anyway, thank you. Points for you
0
 
ho_alanCommented:
thx, u're welcome :-)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now