Help to send answers in jQuery [closed]

1

I have a survey screen and I wanted to know how I would load the text of the selected radios on another screen?

    
asked by Crissaegrim 14.10.2016 в 03:11
source

4 answers

0

I do not know if this will be worth

  $.ajax({
      type: "POST", //POST O GET 
      url: url, 
      data: data,
      success: success,
      dataType: dataType
    });

To pick up the value of a radiobutton

<input type="radio" name="edad" id="edad1" value="20"> 20<br>
<input type="radio" name="edad" id="edad2" value="30"> 30<br>
<input type="radio" name="edad" id="edad3" value="40"> 40 

var a = $('input:radio[name=edad]:checked').val();

In the ajax function of jquery in data (data that you are going to send) send the variable 'a'

Here you have more information: link

    
answered by 14.10.2016 в 08:45
0

If you have to upload to another page, the only way I know is that you will use cookies and store the selected values there and then retrieve them on the other page.

As you have been told, you would need a database, or if not, use PHP, and once the form has been sent, load the next page with the data sent.

    
answered by 14.10.2016 в 09:06
0

If you do not have where to store the survey data on the server, you can use the javascript browser memory localStorage or sessionStorage .

    
answered by 14.10.2016 в 09:06
0

Ideally, you should save this information in some database, and the information will be called from the other page.

The problem is that if you use only Javascript on the client side, reloading the page removes the variables you create.

You need to save it and call that data.

I would recommend you read something about FIREBASE it's very easy and if you do not have advanced knowledge it will surely help you.

    
answered by 14.10.2016 в 03:23