. . .
<script language="JavaScript">
function clearAllFormFields(form) {
for (var x = 0; x < form.length; x++) {
var current = form.elements[x];
if (current.type == "text") {
current.value = "";
}
else if (current.type == "select-one") {
current.selectedIndex = 0;
}
else if (current.type == "file") {
current.value = "";
}
else if (current.type == "textarea") {
current.value = "";
}
else if (current.type == "checkbox") {
current.checked = 0;
} }
return false;
}
</script>
Erik
Koushik wrote:
make that button <html:reset> and in ur form bean u have to write a reset() method where u set to that text field property to null hope it solves ur problem ----- Original Message ----- From: "murukesh radhakrishnan" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, November 07, 2004 9:27 PM Subject: clearing the content of the file upload control
Hi all,
i have a file upload control in my jsp.Next to that control i have a
one more button with label clear attachment.
on clicking on that clear attachment button, i have to clear the
content of the file upload textbox...is there any way by which i can
clear the content of the file upload using javascript.
Regards
Murukesh
---------------------------------
ALL-NEW Yahoo! Messenger - all new features - even more fun!
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]