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: 956 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 2 h 19 m 33 sec
Reputation Power: 32
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 22nd Plane (15500 - 15999 posts)
 
Join Date: Jul 2004
Location: USA
Posts: 15,944 Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Months 3 Weeks 5 Days 12 h 14 m 45 sec
Reputation Power: 1522
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.

I'm looking for new clients.

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: 956 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 2 h 19 m 33 sec
Reputation Power: 32
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 22nd Plane (15500 - 15999 posts)
 
Join Date: Jul 2004
Location: USA
Posts: 15,944 Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Months 3 Weeks 5 Days 12 h 14 m 45 sec
Reputation Power: 1522
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


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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway