Hi All,
I have been spending all night and a large portion of today trying to fix this error, and this is all because i have limited knowledge of javascript.
This is my first post on IT Bytes but i have found most of my answers here before; so i am hoping you's can help me.
I have a javascript that when an onchange event on a select field is triggered it checks the page for previously entered image locations and then enters these image locations into the previously mentioned select box.
This script works fine if i hardcode the field id into it, however i wish to dynamically pass the field id into the script and have it accomplish the task (which is wont). Anyway enough yapping from me the code is below thank you.
so the thought is that field_id would be provided to the script by onchange="retur n attributesimage s(this.id);" however when i run the script the below error comes back;
All help appreciated.
Regards,
Justin
I have been spending all night and a large portion of today trying to fix this error, and this is all because i have limited knowledge of javascript.
This is my first post on IT Bytes but i have found most of my answers here before; so i am hoping you's can help me.
I have a javascript that when an onchange event on a select field is triggered it checks the page for previously entered image locations and then enters these image locations into the previously mentioned select box.
This script works fine if i hardcode the field id into it, however i wish to dynamically pass the field id into the script and have it accomplish the task (which is wont). Anyway enough yapping from me the code is below thank you.
Code:
function attributesimages(field_id)
{
if (document.forms['addform'].image_caption_0.value == "") {
// Forget it...
}
else
{
document.forms['addform'].field_id.options[1] = new Option('1.' + document.forms['addform'].image_caption_0.value,'0');
}
}
Code:
Line: 252 Char: 3 Error: 'document.forms.addform.field_id.options' is null or not an object Code: 0
Regards,
Justin
Comment