[eluser]richzilla[/eluser]
Hi all,
Im having a bit of a problem getting the following code snippet to work. Basically the div 'extraUnitPrice' should not be visible if the value of the 'extraType' select box is 'fp'. At present it doesnt do anything at all... can anyone tell me where im going wrong?
Code:
Code:
<label for="extra_type">Extra type: </label>
<select name="extra_type" id="extraType">
<option value="fp">Fixed Price / One Off</option>
<option value="var">Variable</option>
</select>
<div id="extraUnitPrice">
<?php echo form_error('unitprice'); ?>
<label for="unitprice">Unit Price (£): </label>
<input type="text" name="unitprice" value="<?php echo set_value('unitprice'); ?>" />
</div>
[removed]
$(document).ready(function(){
$("#extraType").blur(function(){
if($("#extraType").val() == 'fp')
{
$("#extraUnitPrice").hide();
}
else
{
$("#extraUnitPrice").show();
}
});
});
[removed]
Thanks for any assistance