Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
.character{
}
.test{
}
</style>
<script>
function addZico(formName) {
var j = 0;
var inputs = document.forms[formName].getElementsByTagName('input');
var storeVals = ['Chris','Ollie','Paul'];
for(var i = 0; i < inputs.length; i++) {
if(inputs[i].className == 'character' && inputs[i].value == '' && inputs[i].type == 'text'){
inputs[i].value = storeVals[j];
j++;
if(j == 3) break;
}
}
}
</script>
</head>
<body>
<form name="form1">
<input type='text' value='90' class='character' /><br/>
<input type='text' value='' class='test' /><br/>
<input type='text' value='' class='character' /><br/>
<input type='text' value='90' class='character' /><br/>
<input type='text' value='' class='character' /><br/>
<input type='text' value='' class='character' /><br/>
<input type='text' value='' class='test' /><br/>
<input type="button" value="click" onclick="addZico('form1');" />
</form>
</body>
</html>
I think your need is similar to the above code? Try to use the JS function
Bookmarks