AnsweredAssumed Answered

reset value on relate field

Question asked by Rainolf Ray on May 8, 2015
Hi to all,
sugarcrm ce 6.5.

I'm trying to reset value on my custom relate field with a custom js code.

Based on a dropdown selection i would like to reset some related values like this:

 $("#dbg_service_c").change(function() {
        var selected = $(this).val();
        //alert(selected);
        switch(selected) {
            case 'A':
                // Clear input field and resets its value -> for different fileds
                $('#relate_pol_c, #relate_pod_c, #relate_pcarrier_c').attr('value',"");
                $('#relate_aol_c, #relate_aod_c, #relate_acarrier_c').attr('value',"");
        break;

.........

but it doesn't work

with firebug for example i can see the value cleared but when i try to save an error comes:
"No match for field: ...."

Maybe the DOM can't see the change....and i've tried also with:
$('#relate_aol_c, #relate_aod_c, #relate_acarrier_c').val("");

with no luck...

Any help please??

Thank you

Outcomes