initialization - Javascript : ReInitialize Global Variable without refreshing the page -


i have page containing form fields menus. on clicking button, form fields should validated , errors should displayed in row of table on modal window.

i have declared global variable capture errors of different field. global variable string , error gets added rows shown below

first initialize global variable var gerrortablerow = "";

the same variable keeps append table row based on errors of particular field name shown below.

gerrortablerow += '<tr><td>'+sfieldname+'</td><td>enter non 0 value</td></tr>'; 

the table row shall displayed on modal window on clicking button.

but variable gerrortablerow getting append errors again , again after re initialize if variable 'gerrortablerow = "" ;' after modal window show., on clicking button.

how re initialize gerrortablerow variable without refreshing page.

i re edited based on comments, hope clear now.

you run code assigning new value, instance:

gerrortablerow = ""; 

Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -