PDA

View Full Version : Check and uncheck to empy and restore textbox valu


ngaisteve1
02-04-2003, 10:55 AM
I want to make the text box besides me empty when I check the checkbox next to it. But, when I uncheck it, the value will restore back. Can it be done? My existing code is below

function emptyit_mydebt()
{
tmpMyDebt1 = document.myform.mydebt_fr.value;
tmpMyDebt2 = document.myform.mydebt_fr.value;
if (document.myform.mydebt_chk.checked == true)
tmpMyDebt1 = "";
else
document.myform.mydebt_fr.value = tmpMyDebt2;
}

function emptyit_job()
{
document.myform.job_fr.value = "";
}

function emptyit_others()
{
document.myform.other_sources_fr.value = "";
}

function emptyit_inhand()
{
document.myform.inhand_fr.value = "";
}