TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 06-18-2009, 04:26 AM   #1 (permalink)
The Contributor
 
Join Date: May 2008
Posts: 36
Thanks: 5
Kay1021 is on a distinguished road
Default onSelect/onDeselect working at same time?

I'm kinda a newbie to Javascript but i have seemed to figure out one part of what i am trying to do and need help with the second part. What i am trying to do is this checkbox that has a style from here http://lipidity.com/fancy-form/. But what i wanted was that once you click select or deselect the checkbox that it is automatically updated to the database. I was already doing something like this with a textarea and i finally figured out how to get it to work with my checkbox. I used part of the help the site gave..
Code:
FancyForm.start( 0, {
	onSelect: function(chk){
		alert(chk.inputElement.getProperty('name'));
	}
});

and rearranged it and used some of my other code and got it to actually work for what i need. My code:
Code:
FancyForm.start(0, {
		onSelect: function(chk) {		
			var url = 'schoolPage.php?catID=' + chk.inputElement.getProperty('id') + '&chk=' + chk.inputElement.getProperty('checked');
				var request = new Request({
					url:url,
					method:'POST',
					onRequest: function() {
						alert('making sure it works:: ' + url);
					}
				}).send();
			
			
		}
		
	});
so that works ....and if change it to onDeselect it works....when you uncheck a box....however i some how need them both in there....and so when you select or deselect the box that it will send the info. Being new to javascript I just can figure out the prop
Kay1021 is offline  
Reply With Quote
 



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

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Timezone Class: Dealing with Timezones the Proper Way Wildhoney General 2 01-10-2011 11:01 PM
php time? DizzyD General 20 06-10-2009 10:11 PM
Two Different Ways to Format the Time CMellor Tips & Tricks 0 09-24-2007 11:12 PM
Script Execution Time Class Wildhoney Script Giveaway 2 09-14-2007 11:36 PM
Calculating the Execution Time Wildhoney Tips & Tricks 0 09-14-2007 11:14 PM


All times are GMT. The time now is 04:40 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design