View Full Version : Input on form
I need to create a input text area so when the html form opens I can input certain letters and it will pass it along to the FORM ACTION
Such as:
<form action=/cle/S/car/none/x method=post>
this is how it reads now and works but at times I need to change the cle to cin and others, any idea how to make a input box so I can fill it in?
Kitchensink108
2-26-06, 10:07 PM
Wait, are you saying you want to be able to have the user specify the form action?
Wait, are you saying you want to be able to have the user specify the form action?
that is correct, since the form is on my desktop, I will be the one subnitting th changes , so yes...
Kitchensink108
2-26-06, 10:22 PM
maybe this?<form method="post" action="" id="form">
<input type="text" id="textin" onkeyup="refresh()">
</form>
<script type="text/javascript">
function refresh() {
document.getElementById("form").action=document.getElementById("textin").value;
}
</script> I've never tried changing the action dynamically, so I'm hoping it's handled just like any other html attribute.
maybe this?<form method="post" action="" id="form">
<input type="text" id="textin" onkeyup="refresh()">
</form>
<script type="text/javascript">
function refresh() {
document.getElementById("form").action=document.getElementById("textin").value;
}
</script> I've never tried changing the action dynamically, so I'm hoping it's handled just like any other html attribute.
I cant get this to work...
I did a dynamic action change using 2 forms and making a selection in one form be the action of the other. I have a drop-down list, but I guess you could use a text area as well.
See http://troop53.net/search.htm
The javascript is in the head, and you can dissect the forms to see how I did it. Use what you need.
Good luck,
Kevin
I did a dynamic action change using 2 forms and making a selection in one form be the action of the other. I have a drop-down list, but I guess you could use a text area as well.
See http://troop53.net/search.htm
The javascript is in the head, and you can dissect the forms to see how I did it. Use what you need.
Good luck,
Kevin
Thanks but this still is the same problem.. I cant get it to pass it along..
Ive create dforms in the past with no problem but this one is a problem
YvetteKuhns
2-27-06, 11:42 AM
I need to create a input text area so when the html form opens I can input certain letters and it will pass it along to the FORM ACTION
Could you post your form page, so we can get a better idea what you are trying to do?
<form action="formscript.php" method="post" name="formname">
<input type="submit" value="submit">
<script language="JavaScript">
Put your Javascript inside the form and use hidden input or user selected input.
</script>
</form>
I think you are trying to make the form go to itself instead of using an external form action script and that may be the problem. You can't use two forms simultaneously on the same page, so if you have a Javascript submit, you need to include it in your main form.
Kitchensink108
2-27-06, 07:17 PM
Here's the script I posted above, working:
http://kyle.barr.name/files/form_action.html
The area under the line displays the form's current action attribute.
vBulletin v3.6.0, Copyright ©2000-2010, Jelsoft Enterprises Ltd.