Question

I want to create something like, when i select a value from a dropdown and clicked on submit button then a check box will be checked. For eg:

if (value of dropdown==1)

checkbox is checked

else

checkbox is not checked

can it possible in ROR? Thank you.

Was it helpful?

Solution

Use JQuery,

$('#myform').submit(function( event ) {

  var selected_value = $('#Crd option:selected').text();

  if(selected_value == "myValue"){
    $('#my_check_box').prop('checked', true);
  }

}):
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top