Hello again, I have tried to implement the code into my form and am getting an error when I click on one of my images.
Here are 2 of my images:
Code:
<img value="1" onclick="changevalue(this);" />
<img value="2" onclick="changevalue(this);" />
here is the JavaScript in my <head>
Code:
<script language="javascript">
function changevalue(obj)
{
Select_Value_Set("DDvehAttr","mainForm",obj.value);
}
/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com
Created by: Francis Cocharrua :: http://scripts.franciscocharrua.com/ */
function Select_Value_Set(SelectName,FormName,Value) {
eval('SelectObject = document.' + FormName + '.' + SelectName + ';');
for(index = 0;
index < SelectObject.length;
index++) {
if(SelectObject[index].value == Value)
SelectObject.selectedIndex = index;
}
}
</script>
and here is my drop down menu which is within a form called mainForm
Code:
<select onKeyPress="return disableEnterKey(event)" id="DDvehAttr" class="FormField" onchange="DDvehAttrChanged(this)" >
<option value="-1">Please Select . . .</option>
<%
for (i=0; i < vehAttr.length; i++)
{%>
<option value="<% = i %>"><% = vehAttr[i] %></option>
<%}
%>
</select>
When I click on one of the images I get the following error.
Message: 'SelectObject.length' is null or not an object
Can you see why this is happening?
Thanks
Bookmarks