0

How can I transfer the values inserted in <input type="text" name="num1"> to radio button <input type="radio" name="rep_num1" value="">On submit of form.
Actuall when user insert the value or text in the textbox the value of the text box should replace or transfer to the value in radio button when user click on submit.
example if the user typed hello in text box on submitting the form the "hello" should replace the blank value of radio button as on submit the radio button should have the value "hello"
Please help me Thanxx
The code should be in javascript or HTML if possible
Thanxx

2
Contributors
1
Reply
6
Views
5 Years
Discussion Span
Last Post by Topi Ojala
1

This does not sound like a good way to implement a form :)

Anyhow, you can attach your submit button to a javascript function, in which you can make a customized POST call with ajax

function submitForm()
{
 //select the text value with native js or jquery
 var text = $('.classOftextInput').attr( value );

 //make the custom POST string to map the text with rep_num1
 var postString = 'rep_num1=' + text;

 //use native js or jquery AJAX to submit the form with POST
 $.ajax( '/formBackend' ,
     { 
         'type': 'POST',
         'data': postString,
     }).done( function(data)
         {
            // give information to the user about form submit ( success/ fail )
         });

This might not be 100% accurate, but you get the idea

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.