}
}
-function resetValues( filter ) {
- if (filter) {
- cj("#select_org div").find( 'input[type=text], select, textarea' ).each(function( ) {
- if ( cj(this).attr('name') != 'onbehalf[organization_name]' ) {
- cj(this).val('');
- }
- });
- }
- else {
- cj("#select_org div").find( 'input[type=text], select, textarea' ).each(function( ) {
- cj(this).val( '' );
- });
- }
- cj("#select_org tr td").find( 'input[type=radio], input[type=checkbox]' ).each(function( ) {
- cj(this).attr('checked', false);
- });
+function resetValues() {
+ cj('input[type=text], select, textarea', "#select_org div").not('#onbehalfof_id').val('');
+ cj('input[type=radio], input[type=checkbox]', "#select_org tr td").prop('checked', false);
}
function createNew( ) {
var textMessage = ' {/literal}{ts escape="js"}Use existing organization{/ts}{literal} ';
cj("#onbehalf_organization_name").removeAttr('readonly');
cj("#mode").removeAttr('checked');
- resetValues( false );
+ resetValues();
}
else {
var textMessage = ' {/literal}{ts escape="js"}Enter a new organization{/ts}{literal} ';
function setLocationDetails(contactID) {
- resetValues(true);
+ resetValues();
var locationUrl = {/literal}"{$locDataURL}"{literal} + contactID + "&ufId=" + {/literal}"{$profileId}"{literal};
cj.ajax({
url : locationUrl,
}
if ( reset ) {
- resetValues( false );
+ resetValues();
}
}