How to clear value of g:ui_reference box in UI Page when user select different option?

bbf3562
Kilo Guru

There are 2 dropdown options for admin to select. If the admin select option #2 and type something in reference field search box but changed mind and select option #1, the ui reference field will change but the previous ui reference field still have remaining input value that need to be cleared. If click Option #2 again, it will switch back to first reference field but the old value that admin typed is still there. I have tried use gel('test').value = ""; but it isn't working. Anyone know why?

Here are my sample code,

find_real_file.png

find_real_file.png

1 ACCEPTED SOLUTION

Try:


document.getElementById('sys_display.test').value = '';


document.getElementById('test').value = '';


View solution in original post

7 REPLIES 7

leochavez
Tera Guru

Try 'g_form.setValue('your_variable', "")'



- Leo


I tried g_form.setValue('test', ""); It broke javascript.


I am not removing any data in table. I just need to clear the left over text on reference textbox that the user have not submit it.