ibjdt
Programmer
- Nov 25, 2002
- 63
i have a data table containing sometimes hundreds of rows - each with it's own 'edit' link.
the link contains an onclick call to javascript to show a div in the next table row.
the div form allows data update, but i can't allow a 0 value so i tried to check the form like this
the alert is a test and it works - passes the correct item number - but not the rest.
i don't want to loop through all the elements to determine which was submitted because there can be hundreds and it would take too long.
thanks.
the link contains an onclick call to javascript to show a div in the next table row.
Code:
function make(item){
document.getElementById(theDIV).innerHTML = '<form name=invEdit'+item+' onSubmit="return checkInvEdit('+item+');"><input name=VartoChange....>';
}
the div form allows data update, but i can't allow a 0 value so i tried to check the form like this
Code:
function checkInvEdit(item){
alert(item);
var VartoChange = document.invEdit['item'].VartoChange.value;
if (VartoChange == "" || VartoChange == "0") { alert ('\n- Please enter a non-zero value'); return false; }
}
the alert is a test and it works - passes the correct item number - but not the rest.
Code:
document.invEdit.item is null or not an object
i don't want to loop through all the elements to determine which was submitted because there can be hundreds and it would take too long.
thanks.