O
otherblandart
Hi All!
I've dug and dug and can't seem to find what should be a simple
solution (disclaimer: I'm VERY new at javascript).
Basically, I have a simple form, with a number of text boxes, a drop
down or two, and a group of radio buttons (used to select a phone
model from 4 options, paired with images of the 4 phones). What I want
is to set the onClick for each image to select the corresponding
option button. here's what I have so far:
In the <head>:
<script type="text/javascript">
<!--
function pickOpt(theValue) {
var dfe = document.SPOrdDet.radModel;
dfe[theValue].checked=true;
return
}
//-->
</script>
In the <form> (included line breaks for readability here)
<input type="radio" name="radModel" value="SPR8703">
<img border="0"
src="images/SP8703e.gif" width="104" height="166" align="middle"
onclick="javascript
ickOpt(0);">
<input type="radio" name="radModel" value="SPR8830">
<img border="0"
src="images/SP8830.gif" width="97" height="166" align="middle"
onclick="javascript
ickOpt(1);">
<input type="radio" name="radModel" value="VZW8703">
<img border="0"
src="images/VZ8703e.jpg" align="middle"
onclick="javascript
ickOpt(2);">
<input type="radio" name="radModel" value="VZW8830">
<img border="0"
src="images/VZ8830.jpg" width="95" height="166" align="middle"
onclick="javascript
ickOpt(3);">
No matter what I try (in addition to the script piece above I've tried
several other contructs, including looping through each option), I get
either an 'Object Expected' or 'document.SPOrdDet.radModel' is null or
not an object' error.
I'm using FrontPage (I know, but it's what my employer has to work
with
, and all the above is in an asp file.
This thing is driving me nuts! Any and all input is greatly
appreciated!!
I've dug and dug and can't seem to find what should be a simple
solution (disclaimer: I'm VERY new at javascript).
Basically, I have a simple form, with a number of text boxes, a drop
down or two, and a group of radio buttons (used to select a phone
model from 4 options, paired with images of the 4 phones). What I want
is to set the onClick for each image to select the corresponding
option button. here's what I have so far:
In the <head>:
<script type="text/javascript">
<!--
function pickOpt(theValue) {
var dfe = document.SPOrdDet.radModel;
dfe[theValue].checked=true;
return
}
//-->
</script>
In the <form> (included line breaks for readability here)
<input type="radio" name="radModel" value="SPR8703">
<img border="0"
src="images/SP8703e.gif" width="104" height="166" align="middle"
onclick="javascript
<input type="radio" name="radModel" value="SPR8830">
<img border="0"
src="images/SP8830.gif" width="97" height="166" align="middle"
onclick="javascript
<input type="radio" name="radModel" value="VZW8703">
<img border="0"
src="images/VZ8703e.jpg" align="middle"
onclick="javascript
<input type="radio" name="radModel" value="VZW8830">
<img border="0"
src="images/VZ8830.jpg" width="95" height="166" align="middle"
onclick="javascript
No matter what I try (in addition to the script piece above I've tried
several other contructs, including looping through each option), I get
either an 'Object Expected' or 'document.SPOrdDet.radModel' is null or
not an object' error.
I'm using FrontPage (I know, but it's what my employer has to work
with
This thing is driving me nuts! Any and all input is greatly
appreciated!!