If I have around 50 textboxes (the name attribute is common like row1col1, row1col2. row2col1 row2col2 etc.... in a form and I wanted to check via Java Script that they were not blank, how could I do this?
Apart from having to individually check each box.
Java Script array of objects
Ok got that part figured out.
I have another question related to form verification using javascript.
I want to check the form and then create a new page with the form information (I'm using document.write).
The problem is the variables are blank when I do a
I have another question related to form verification using javascript.
I want to check the form and then create a new page with the form information (I'm using document.write).
The problem is the variables are blank when I do a
Code: Select all
document.write(var)
Only Human
Well.....
Here is the javascript snippet.
It just copies the contents of the textboxes to a local variable and then displays them as readonly textboxes in another page.
Here is the javascript snippet.
It just copies the contents of the textboxes to a local variable and then displays them as readonly textboxes in another page.
Code: Select all
<SCRIPT language="JavaScript">
function checkForm(myForm)
{
var cell = Array(myForm.rc.length);
for(var cellCnt=0; cellCnt<10; cellCnt++)
{
cell[cellCnt] = parseInt(myForm.rc[cellCnt].value)
}
// create the new page.
document.write("<HTML><HEAD><TITLE>The New Page</TITLE></HEAD>\n");
document.write("<BODY><CENTER><H2>The Generated table is</H2>\n");
document.write("<TABLE BORDER=0 BGCOLOR=LIGHTBLUE\n");
for(var cellCnt=0; cellCnt<10; cellCnt++)
{
document.write("<TR>\n");
document.write("\t<TD><INPUT TYPE=TEXT SIZE=1 READONLY VALUE="+cell[cellCnt]+"></TD>\n");
document.write("</TR>\n");
}
document.write("</TABLE>\n<CENTER>\n");
document.write("</BODY>\n");
document.write("</HTML>\n");
}
</SCRIPT>
Only Human