hi, i have mapped a keyboard out on my htm page and want to populate a text field on an onclick event.. an example button..
<input type="button" name="1" style="Width: 40px; Height: 40px;" class="buttontext" value="1" onClick="Select1()">
this works fine but i dont want to repeat the code below for each letter & number in the alphabet.
can anyone show me how to put it in a loop? Need to pass the letter number to the function and retuen it to the textfiled? there is also a clear button, back space, etc...
function Select1() {
if (form1.hiddenPointer.value == 0) {
if (form1.textfield_Start.value.length > -1)
string = document.form1.textfield_Start.value + "1";
else
string = document.form1.textfield_Start.value
document.form1.textfield_Start.value = string;
}
else {
if (form1.textfield_End.value.length > -1)
string = document.form1.textfield_End.value + "1";
else
string = document.form1.textfield_End.value
document.form1.textfield_End.value = string;
}
}
kindest regards...