Solved

Form Action = textbox value

Posted on 2003-11-13
3
632 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
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…

733 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