Fix 4: test on selected value was lenght > 0 but if value is 0, lenght

is 1 and we want flase here.
Fix 5: Button Add is enabled once a predefined product is selected.
This commit is contained in:
Laurent Destailleur 2012-08-27 13:54:14 +02:00
parent cc22f25d97
commit 625f53a708

View File

@ -217,7 +217,7 @@ $(document).ready(function() {
$('#service_duration_area').hide(); $('#service_duration_area').hide();
$('#idprod').change(function() { $('#idprod').change(function() {
if ($(this).val().length > 0) if ($(this).val() > 0)
{ {
<?php if (! empty($conf->fckeditor->enabled) && ! empty($conf->global->FCKEDITOR_ENABLE_DETAILS)) { ?> <?php if (! empty($conf->fckeditor->enabled) && ! empty($conf->global->FCKEDITOR_ENABLE_DETAILS)) { ?>
// We use CKEditor // We use CKEditor
@ -226,8 +226,9 @@ $(document).ready(function() {
// We use a simple textarea // We use a simple textarea
$('#product_desc').focus(); $('#product_desc').focus();
<?php } ?> <?php } ?>
$('#addlinebutton').removeAttr('disabled');
} else { } else {
$('#addlinebutton').attr('disabled','disabled');
$('#update_desc_checkbox').removeAttr('checked').trigger('change'); $('#update_desc_checkbox').removeAttr('checked').trigger('change');
$('#update_price_checkbox').removeAttr('checked').trigger('change'); $('#update_price_checkbox').removeAttr('checked').trigger('change');
} }