1
0
-1

Hi

i have a Selectbox  - Agency, on selection change i wantt to evaluate if its not MyCompany then the Radio Button - Status to change to 'Contingent'

im useing the follwoing code but its not working, the alret pop up when the select box is changed but the radio button does not get updated

<script type="text/javascript">
$('[name$=Agency]').change(function() 
{
	var mySelectedValueId = $(this).find(':selected').val();
	$('[name$=SelectedValueId]').val(mySelectedValueId);
	  if (mySelectedValueId !== "MyCompany") 
	{
     alert(mySelectedValueId);
     $("#Status").prop("Contingent", true);
     $('input[name=Status]:checked').val("Contingent") 
    }
});
</script>

regards


    CommentAdd your comment...

    2 answers

    1.  
      1
      0
      -1

      @Anders Thanks for pointing me to the right directions

      i used the following code and it works for me

      <script type="text/javascript">
      $('[name$=Agency]').change
      (
      	function()
      	{
      		var mySelectedValueId = $(this).find(':selected').val();
      		$('[name$=SelectedValueId]').val(mySelectedValueId);
      	    if (mySelectedValueId !== "MyCompany") 
      		{
      			$("input[name=Status][value='Contingent']").prop("checked",true);
      		}
      		if (mySelectedValueId == "MyCompany") 
      		{
      			$("input[name=Status][value='Permanent']").prop("checked",true);
      		}
      	}
      );
      </script>
        CommentAdd your comment...
      1.  
        1
        0
        -1

        Hi, the code to change a radio button selection is incorrect, try following the examples from https://stackoverflow.com/questions/5665915/how-to-check-a-radio-button-with-jquery

          CommentAdd your comment...