I have "cancel" button in php files. I want to write common javascript function for cancel button. When user click cancel button I want to clear php form data.
Is it possible?
JS code
Is it possible?
Code:
<input id="Cancel" src="Cancel.jpg" type="image" alt="cancel" onclick="Cancel('cancel');"/>
Code:
function Cancel(cancel){
if(cancel=='cancel'){
document.getElementById('No').value='';
document.getElementById('FullName').value='';
document.getElementById('Address').value='';
document.getElementById('Email').value='';
}
}
Comment