<form id="feedback-form" method="post" action="contactvalidate.php" action="javascript:alert('success!');">
<label>Name</label><input class="required inpt" type="text" name="name" value="" /><br />
<label>Company Name</label><input class="required inpt" type="text" name="companyname" value="" /><br />
<label>E-Mail</label><input class="required inpt" type="text" name="email" value="" /><br />
<label>Phone Number</label><input class="required inpt" type="text" name="phone" value="" /><br />
<label style="margin-bottom:10px">Have you ordered from us?</label><input class="radio" type="radio" name="order" value="Yes" />Yes <input class="radio" type="radio" name="order" value="No" />No<br />
<label>Your level of satisfaction</label>
<select name="satisfaction" id="satisfaction" class="select">
<option value="">--Select One--</option>
<option value="Very Satisfied">Very Satisfied</option>
<option value="Moderately Please">Moderately Pleased</option>
<option value="Somewhat Dissatisfied">Somewhat Dissatisfied</option>
<option value="Very Dissatisfied">Very Dissatisfied</option>
</select><br />
<!-- <input class="required inpt" type="text" name="subject" value="" /> --><br />
<label>Comments</label><textarea class="textbox" name="message" rows="6" cols="30"></textarea><br />
<label>Is it okay for us to use your comments as a testimonial in our marketing?</label><input class="radio" type="radio" name="testimonial" value="Yes" />Yes <input class="radio" type="radio" name="testimonial" value="No" />No<br />
<label id="load"></label><input name="submit" type="image" class="btn" src="images/submit.gif" value="Send" />
</form>
<!--end #footer--></div>
<script type="text/javascript">
function getIndex()
{
var x=document.getElementById("satisfaction");
if (x.selectedIndex == 'Very Satisfied' , 'Moderately Please');
{
$('#testimonial').show();
}
else
{
$('#testimonial').hide();
}
}
</script>
5 replies to this topic
#1
Posted 02 November 2011 - 07:12 AM
I have searched and can't find anything to help me. I want to make it so if the element "satisfaction" is either x or y then it will display element "testimonial" if not then keep element "testimonial" hidden. This is what I have so far but it isn't working. Any help would be greatly appreciated
|
|
|
#2
Posted 03 November 2011 - 06:35 AM
x.selectedIndex gives you an index. Not the option or anything, just the number of the selected option. You'll need something like
var index = x.selectedIndex; ... x.options[index].value == 'Very Satisfied' ...
#3
Posted 03 November 2011 - 10:35 AM
Hmm I tried that but the conditional radio box is still showing up.
#4
Posted 03 November 2011 - 11:13 AM
Maybe cause
[COLOR=#333333][FONT=monospace]$('#testimonial')[/FONT][/COLOR]
Will select stuff with class "testimonial"
#5
Posted 03 November 2011 - 12:13 PM
Hmm I thought I needed that if I wanted the checkbox to show if someone had Very Satisfied or Moderately Pleased and if one of those two aren't selected then it needs to stay hidden
#6
Posted 04 November 2011 - 05:38 AM
Read my previous post again...
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









