Forum Moderators: open
Here is my problem.
A simple js to set a value of a form field you would use something like this.
document.formname.inputname.value = 'whatever i choose';
My problem is ... My form input name is called:
"details[Price]"
So when i try and set the value it fails to do so, e.g.
document.formname.details[Price].value = 'whatever i choose';
Is there a simple solution?
Del
Code is below for you guys to copy and paste if need be.
<script>
function changePrice(finalValue)
{
document.formName.details[Price].value = finalValue;
}
</script><form name="formName">
<input name="details[Price]">
</form>
<a href="#" onClick="changePrice('22.99')">change</a>