|
|||||||
| JavaScript JavaScript (not Java) Discussion and technical support, including AJAX and frameworks (JQuery, MooTools, Prototype...) |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Javascript survey
I did a simple javascript survey that the 'Don't know' is checked so if you go to next it should go to 2 and then 3 but its acting screwy (specially on FF). Seems like you still have to click so it can work... can anyone see the issue? Here's the page:
http://www.staples.com/sbd/cre/progr...ss/helpme.html And the code: In Head: Code:
<script type="text/javascript">
function setNext (nextpage) {
document.helpme.nextpage.value=nextpage;
}
Code:
<form action="#" method="get" name="helpme">
<div class="c07">
<h4 class="a1100">Questionnaire</h4>
<div class="b1101">
<div class="f02">
<ol>
<li>Will your organization always pay your Staples Business Credit Account balance in full each month?</li>
</ol>
<p><b>Select one:</b></p>
<p><input type="radio" name="balance" id="balyes" class="radio" onClick="setNext('helpme2.html')" /><label for="balyes" class="radiolabel">Yes</label></p>
<p><input type="radio" name="balance" id="balno" class="radio" onClick="setNext('helpme5.html')" /><label for="balno" class="radiolabel">No</label></p>
<p><input type="radio" name="balance" id="balunk" class="radio" onClick="setNext('helpme2.html')" checked /><label for="balunk" class="radiolabel">Don't know</label></p>
<input type="hidden" name="nextpage" value="helpme2.html" />
</div>
</div>
<div class="d22"><a class="d03" href="/sbd/cre/programs/credit/">Cancel</a> <a class="d01" href="#" onClick="document.location=document.helpme.nextpage.value;">Next</a></div>
</div>
</form>
|
|
#2
|
|||
|
|||
|
You have a name and a value the same
function setNext (nextpage) { document.helpme.nextpage.value=nextpage; } Change one of them and see if that cures the problem <script type="text/javascript"> function setNext (nextURL) { document.helpme.nextpage.value=nextUrl; }
__________________
The Silent One The most dangerous thing in the world is an idea. The most dangerous person in the world is one with an idea |
|
#3
|
|||
|
|||
|
Thanks! I added them on my local mac/pc.
Well it looks like it still doesn't function. Here's what happens in IE-Safari: I have checked 'Don't know in helpme.htm, so it should go to 'helpme2'...(which it does). Then helpme2 should go to 3 but instead it goes to helpme4 (I just click 'Next' from helpme.htm). The only way it works if you actually click the already checked 'don't know'....so a little confused... If I click on yes or no it works fine BTW.... ------ However.... in FF when I hit next in helpme.htm it just stays there and adds a pound (helpme.htm#) If I click Yes or no still nothing happens. Thanks! Last edited by riskmod; 04-02-2007 at 03:03 PM. Reason: adding |
|
#4
|
|||
|
|||
|
I'm not completely sure what you're trying to do, but assuming html2.htm etc. are separate pages (as it appears) this might be what you're looking for (or close) in helpme.htm:
Code:
<html>
<script type="text/javascript">
function setNext (nextPage) {
document.helpme.action=nextPage;
}
</script>
<body>
<form id="helpme" name="helpme" action="helpme2.html" method="get">
<div class="c07">
<h4 class="a1100">Questionnaire</h4>
<div class="b1101">
<div class="f02">
<ol>
<li>Will your organization always pay your Staples Business Credit Account balance in full each month?</li>
</ol>
<p><b>Select one:</b></p>
<p><input type="radio" name="balance" id="balyes" class="radio" value="balyes" onClick="setNext('helpme2.html')" /><label for="balyes" class="radiolabel">Yes</label></p>
<p><input type="radio" name="balance" id="balno" class="radio" value="balno" onClick="setNext('helpme5.html')" /><label for="balno" class="radiolabel">No</label></p>
<p><input type="radio" name="balance" id="balunk" class="radio" value="balunk" onClick="setNext('helpme2.html')" checked /><label for="balunk" class="radiolabel">Don't know</label></p>
</div>
</div>
<div class="d22"><a class="d03" href="/sbd/cre/programs/credit/">Cancel</a> <a class="d01" href="javascript: document.helpme.submit();">Next</a></div>
</div>
</form>
</body>
</html>]
|
|
#5
|
|||
|
|||
|
Success
OMG YOU ARE GOD!
That's it thanks!!! WooW |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|