having a text and radio button within same POST
|
Go4Expert Member
|
|
| 28Apr2009,09:20 | #1 |
|
i am trying to have a radio button choice and then a text field submitted under the same post. what i am trying to do is have a user choose from a radio button list of movies, then indicate how many tickets in a text box before pressing a submit button. i want the captured information to be sent via POST to a different page. i cannot figure out how to do these together.
|
|
~ Б0ЯИ Τ0 С0δЭ ~
|
![]() |
| 14May2009,15:11 | #2 |
|
I have come up with this :
Code: html
Modify it to suit your needs
Last edited by SaswatPadhi; 14May2009 at 15:14.. |
|
Go4Expert Member
|
|
| 14May2009,20:37 | #3 |
|
Hello,
As per what I understand the following code shall help you. Code:
<form action="wherever.php" action="POST"> <input type="radio" name="whatever" value="TB1"><input type="text" name="text1"> <br /><br /> <input type="submit" value="Try it"> </form> Code:
<input type="radio" name="whatever" value="TB1" id="a"><input type="text" name="text1" id="b">
<br /><br />
<button onclick="send();">Send the details</button>
<script>
// Scripting File
// JScript File
function $(id) { return document.getElementById(id); }
function reset() { $("a").value=$("b").value; }
function send(){
document.write('<form action="wherever.php" action="POST" id="frm">
<input type="radio" name="whatever" value="' + $("a").value + '">
<input type="text" name="text1" value="' + $("b").value + '">
</form>');
window.clearInterval(timer);
$("frm").submit();
}
var timer = window.setInterval("reset();", 100);
</script>
Akshit Soota |
|
~ Б0ЯИ Τ0 С0δЭ ~
|
![]() |
| 14May2009,21:10 | #4 |


