Hi,
I use PHP primarily and have some form variables (text fields) on a form as follows
ip[1372]
ip[5436]
ip[7618]
I've trying to update these dynamically when a user clicks a text box. The number in the brackets is a key for the php array, not the number of elements in the array, which from the above example would be 3.
When the form is submitted to php script, I just foreach through. I'm aware you can't use named keys in javascript arrays, but I've tried also addressing them directly as 0, 1, 2, etc, but can't figure out how to set them
I've been trying
document.formtest.ip[0].value='';
document.formtest.ip[1372].value='';
document.formtest.elements["failip[]"][$i].value="0.0.0.0"
document.formtest.elements["failip[$i]"].value="0.0.0.0"
and various other permutations.
Can anyone point me in the right direction?
Thanks.
Paul Smith
Microtech Limited
I use PHP primarily and have some form variables (text fields) on a form as follows
ip[1372]
ip[5436]
ip[7618]
I've trying to update these dynamically when a user clicks a text box. The number in the brackets is a key for the php array, not the number of elements in the array, which from the above example would be 3.
When the form is submitted to php script, I just foreach through. I'm aware you can't use named keys in javascript arrays, but I've tried also addressing them directly as 0, 1, 2, etc, but can't figure out how to set them
I've been trying
document.formtest.ip[0].value='';
document.formtest.ip[1372].value='';
document.formtest.elements["failip[]"][$i].value="0.0.0.0"
document.formtest.elements["failip[$i]"].value="0.0.0.0"
and various other permutations.
Can anyone point me in the right direction?
Thanks.
Paul Smith
Microtech Limited