www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Client-Side Development > JavaScript

    JavaScript JavaScript (not Java) Discussion and technical support, including AJAX and frameworks (JQuery, MooTools, Prototype...)

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1  
    Old 04-02-2007, 11:11 AM
    riskmod riskmod is offline
    Registered User
     
    Join Date: Oct 2006
    Posts: 143
    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;
    }
    In Body:

    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>
    Reply With Quote
      #2  
    Old 04-02-2007, 01:43 PM
    Mr J Mr J is offline
    Registered User
     
    Join Date: Apr 2003
    Location: UK
    Posts: 2,203
    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
    Reply With Quote
      #3  
    Old 04-02-2007, 02:52 PM
    riskmod riskmod is offline
    Registered User
     
    Join Date: Oct 2006
    Posts: 143
    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
    Reply With Quote
      #4  
    Old 04-02-2007, 04:54 PM
    webadev webadev is offline
    Registered User
     
    Join Date: Mar 2007
    Posts: 21
    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>]
    Reply With Quote
      #5  
    Old 04-02-2007, 05:45 PM
    riskmod riskmod is offline
    Registered User
     
    Join Date: Oct 2006
    Posts: 143
    Success

    OMG YOU ARE GOD!

    That's it thanks!!!

    WooW
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is Off
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 03:04 PM.



    Acceptable Use Policy


    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.