- var financialId = cj("#financial_account_id").val();
- var check = cj(relationID).val();
- if( check == 'select' || financialId == 'select' ){
- callbackURL = callbackURL+"&_value="+financialId;
- cj.ajax({
- url: callbackURL,
- context: document.body,
- success: function( data, textStatus ){
- cj(relationID).html("");//clear old options
- data = eval(data);//get json array
- if ( data != null ) {
- for (i = 0; i < data.length; i++) {
- if( data[i].selected == 'Selected')
- var idf = data[i].value;
- cj(relationID).get(0).add(new Option(data[i].name, data[i].value), document.all ? i : null);
- }
- }
- if( idf != null)
- cj(relationID).val(idf);
- //cj("option:first", relationID).attr( "selected", "selected" );//select first option
-
- }
- });
- if( financialId == 'select' ){
+ var financialId = cj("#financial_account_id").val();
+ var check = cj(relationID).val();
+ if (check == 'select' || financialId == 'select') {
+ callbackURL = callbackURL+"&_value=" + financialId;
+ cj.ajax({
+ url: callbackURL,
+ context: document.body,
+ success: function(data, textStatus) {
+ cj(relationID).html("");//clear old options
+ data = eval(data);//get json array
+ if (data != null) {
+ for (i = 0; i < data.length; i++) {
+ if (data[i].selected == 'Selected') {
+ var idf = data[i].value;
+ }
+ cj(relationID).get(0).add(new Option(data[i].name, data[i].value), document.all ? i : null);
+ }
+ }
+ if (idf != null) {
+ cj(relationID).val(idf);
+ }
+ }
+ });
+ if (financialId == 'select') {