how to send a kind of form without button?

0

I'd like to know how to send a request to the database. in fact not a request but an insert for when I click on radio button it enter the value of radio button on the bank how do I do that?

    
asked by anonymous 22.10.2015 / 18:48

2 answers

5

1 - set an ID for your form eg

2 - Use javascript

$(".classeDoRadio").click(function(){
   $("#idDoForm").submit();
});
    
22.10.2015 / 19:28
-1

You can do the way @MGregor suggested, that submit will automatically call the action page.

See an example code quoted in operation:

$(document).ready(function() {

$("#meuRadio").on('change', function() {
  
    alert('oi');
	});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.1/jquery.min.js"></script><formid="meuForm" method="post" action="minhaPagina.php">  
<input type="radio" name="meuRadio" value="6" id="meuRadio" /><label>opcao</label>
</form>

In place of alert You will insert the line $("#meuForm").submit(); that the form will be submitted to the page that is in the action, in this case it will execute minhaPagina.php .

    
23.10.2015 / 00:34