Doubt
-
Following is the code to clear all text boxes. But It won't be clear when the textbox is "Multiline". Please give the solution as soon as possible. function ClearTextBoxes() { for (i=0;i < document.Form1.elements.length;i++) { if (document.Form1.elements[i].type == "text") document.Form1.elements[i].value=""; } }
-
Following is the code to clear all text boxes. But It won't be clear when the textbox is "Multiline". Please give the solution as soon as possible. function ClearTextBoxes() { for (i=0;i < document.Form1.elements.length;i++) { if (document.Form1.elements[i].type == "text") document.Form1.elements[i].value=""; } }
-
Following is the code to clear all text boxes. But It won't be clear when the textbox is "Multiline". Please give the solution as soon as possible. function ClearTextBoxes() { for (i=0;i < document.Form1.elements.length;i++) { if (document.Form1.elements[i].type == "text") document.Form1.elements[i].value=""; } }
Hi, While rendering to HTML, multiline textbox will be considered as text area. So if you can consider the same in the condition specified, then it will work fine The code is given below function ClearTextBoxes() { for (i=0;i < document.Form1.elements.length;i++) { if (document.Form1.elements[i].type == "text" ||document.Form1.elements[i].type == "textarea" ) { document.Form1.elements[i].value=""; } } } hope this will work for you Rakheesh