show/hide textField

hi frndz…

i have a dropDownList.when i change value of the dropDownList i need to hide textField.

my code is…




<div class="row">

		<?php echo $form->label($model,'standard'); ?>

		<?php //echo $form->textField($model,'standard',array('size'=>60,'maxlength'=>80)); ?>

		<?php echo $form->dropDownList($model,'standard',Lookup :: items(Lookup :: STANDARD_TYPE),array('empty'=>'Select Standard','id'=>"AttendanceStudent_standard",'name'=>"AttendanceStudent[standard]"

				 )); ?>

										

		

		<?php echo $form->error($model,'standard'); ?>

	</div>

       <div class="row" id="mydiv>

		<?php echo $form->labelEx($model,'name'); ?>

		<?php echo $form->textField($model,'name',array('size'=>30,'maxlength'=>160,'id' =>'mydiv')); ?>

		<?php echo $form->error($model,'name'); ?>

	</div>



Jquery is




<script src = "http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js" type="text/javascript"></script>

<script>


$(document).ready(function()

	{

		var dropdown = $('#AttendanceStudent_standard');		

		dropdown.change(function(e)

		//$('#AttendanceStudent_standard').change(function(e)

		{

		//alert(dropdown);

			if(dropdown.val()===1)

			{

				alert('hai');

				$('#mydiv').show();

			}

			else

			{

				

			}

		});

	});

	

</script>	



else{

$(’#mydiv’).hide();

}

thx frnd… i got a solution…:slight_smile: