JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 4th, 2006, 01:05 PM
cranium's Avatar
cranium cranium is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2002
Location: close to the edge
Posts: 964 cranium User rank is Sergeant Major (2000 - 5000 Reputation Level)cranium User rank is Sergeant Major (2000 - 5000 Reputation Level)cranium User rank is Sergeant Major (2000 - 5000 Reputation Level)cranium User rank is Sergeant Major (2000 - 5000 Reputation Level)cranium User rank is Sergeant Major (2000 - 5000 Reputation Level)cranium User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 5 h 58 m 17 sec
Reputation Power: 36
Scroll down after onclick event

Hi all,

I have a page that has some information in paragraph form. At the end of each type of information and paragraph there is a link that a user can click. In the past it took the user to a form lower in the page for them to fill out. I would now like it to also check a checkbox in the form based onclick.

I have that working, but I can no longer get it to scroll down on the page. So it is either one or the other, but not both. Is there a way I can have my cake and eat it too?

Here is some code tidbits so you can see what I am doing:
Code:
// a link
<a href="#scrollDown" onclick="return checkTheBox('hot');" class="float_link">Subscribe Now…</a>

// javascript
function checkTheBox(vl) {
	var el = document.subscribeForm.lid;
	switch(vl) {
		case 'hot':
			el[0].checked = true;
			break;
		case 'spotlight':
			el[1].checked = true;
			break;
		case 'bell':
			el[2].checked = true;
			break;
		case 'today':
			el[3].checked = true;
			break;
		case 'fx':
			el[4].checked = true;
			break;
	}
	return false;  // have tried true here also
}

// the form (part of it)
<form action=" " name="subscribeForm" method="post" onSubmit="return checkForm();">
			<p>I Wish to Receive (please check all desired boxes):</p>
			<label for="lid1">Hot Futures Market:</label><input class="tipInput" type="checkbox" name="lid" id="lid1" value="582505" />
			<label for="lid2">Daily Futures Spotlight:</label><input class="tipInput" type="checkbox" name="lid" id="lid2" value="529884" />
			<br class="left" />
			<label for="lid3">Futures Closing Bell:</label><input class="tipInput" type="checkbox" name="lid" id="lid3" value="529886" />
		</fieldset>
	</form>
	<a name="scrollDown"></a>

Thank you for your time and help,
cranium

Reply With Quote
  #2  
Old October 4th, 2006, 01:29 PM
Kravvitz's Avatar
Kravvitz Kravvitz is offline
CSS & JS/DOM Adept
Dev Shed God 23rd Plane (16000 - 16499 posts)
 
Join Date: Jul 2004
Location: USA
Posts: 16,407 Kravvitz User rank is General 12nd Grade (Above 100000 Reputation Level)Kravvitz User rank is General 12nd Grade (Above 100000 Reputation Level)Kravvitz User rank is General 12nd Grade (Above 100000 Reputation Level)Kravvitz User rank is General 12nd Grade (Above 100000 Reputation Level)Kravvitz User rank is General 12nd Grade (Above 100000 Reputation Level)Kravvitz User rank is General 12nd Grade (Above 100000 Reputation Level)Kravvitz User rank is General 12nd Grade (Above 100000 Reputation Level)Kravvitz User rank is General 12nd Grade (Above 100000 Reputation Level)Kravvitz User rank is General 12nd Grade (Above 100000 Reputation Level)Kravvitz User rank is General 12nd Grade (Above 100000 Reputation Level)Kravvitz User rank is General 12nd Grade (Above 100000 Reputation Level)Kravvitz User rank is General 12nd Grade (Above 100000 Reputation Level)Kravvitz User rank is General 12nd Grade (Above 100000 Reputation Level)Kravvitz User rank is General 12nd Grade (Above 100000 Reputation Level)Kravvitz User rank is General 12nd Grade (Above 100000 Reputation Level)Kravvitz User rank is General 12nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 4 Months 1 Day 14 h 19 m 23 sec
Reputation Power: 1780
Try removing both return statements.
__________________
Spreading knowledge, one newbie at a time.

Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Dynamic Site Solutions

Design/program for Firefox (and/or Opera), apply fixes for IE, not the other way around.

Check out my blog.

Reply With Quote
  #3  
Old October 4th, 2006, 01:39 PM
cranium's Avatar
cranium cranium is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2002
Location: close to the edge
Posts: 964 cranium User rank is Sergeant Major (2000 - 5000 Reputation Level)cranium User rank is Sergeant Major (2000 - 5000 Reputation Level)cranium User rank is Sergeant Major (2000 - 5000 Reputation Level)cranium User rank is Sergeant Major (2000 - 5000 Reputation Level)cranium User rank is Sergeant Major (2000 - 5000 Reputation Level)cranium User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 5 h 58 m 17 sec
Reputation Power: 36
Quote:
Originally Posted by Kravvitz
Try removing both return statements.

That worked. Thank you. Couldn't give you any points as I must have recently. Just out of curiosity, why are the return statements stopping the scroll down?

Reply With Quote
  #4  
Old October 4th, 2006, 02:13 PM
Kravvitz's Avatar
Kravvitz Kravvitz is offline
CSS & JS/DOM Adept
Dev Shed God 23rd Plane (16000 - 16499 posts)
 
Join Date: Jul 2004
Location: USA
Posts: 16,407 Kravvitz User rank is General 12nd Grade (Above 100000 Reputation Level)Kravvitz User rank is General 12nd Grade (Above 100000 Reputation Level)Kravvitz User rank is General 12nd Grade (Above 100000 Reputation Level)Kravvitz User rank is General 12nd Grade (Above 100000 Reputation Level)Kravvitz User rank is General 12nd Grade (Above 100000 Reputation Level)Kravvitz User rank is General 12nd Grade (Above 100000 Reputation Level)Kravvitz User rank is General 12nd Grade (Above 100000 Reputation Level)Kravvitz User rank is General 12nd Grade (Above 100000 Reputation Level)Kravvitz User rank is General 12nd Grade (Above 100000 Reputation Level)Kravvitz User rank is General 12nd Grade (Above 100000 Reputation Level)Kravvitz User rank is General 12nd Grade (Above 100000 Reputation Level)Kravvitz User rank is General 12nd Grade (Above 100000 Reputation Level)Kravvitz User rank is General 12nd Grade (Above 100000 Reputation Level)Kravvitz User rank is General 12nd Grade (Above 100000 Reputation Level)Kravvitz User rank is General 12nd Grade (Above 100000 Reputation Level)Kravvitz User rank is General 12nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 4 Months 1 Day 14 h 19 m 23 sec
Reputation Power: 1780
Well the return false would. I don't know why the return true; would stop it.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Scroll down after onclick event


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT