select fields - instant population!!
Moderator: General Moderators
-
silent assassin
- Forum Newbie
- Posts: 13
- Joined: Mon Feb 27, 2006 6:53 pm
select fields - instant population!!
Hey guys, I don't know if this is possible or not, but I want my users to be able to select a month (Jan, Feb, etc, etc...) and the correct amount of dates populate into a select field next to it.
An example of what I'm looking to do can be found here http://www.nvidia.com/content/drivers/drivers.asp
Basically, I want a field to populate from data in a field on the same page. Is this possible without submitting the actual form? I know its possible in asp, but php? I dunno, I've just started to dig around in it. Tips, tricks, suggestions, all are appreciated. Thanks in advance guys!!
An example of what I'm looking to do can be found here http://www.nvidia.com/content/drivers/drivers.asp
Basically, I want a field to populate from data in a field on the same page. Is this possible without submitting the actual form? I know its possible in asp, but php? I dunno, I've just started to dig around in it. Tips, tricks, suggestions, all are appreciated. Thanks in advance guys!!
Isn't it done with javascript?
maybe this post might help you out:
viewtopic.php?t=45198&highlight=ajax
maybe this post might help you out:
viewtopic.php?t=45198&highlight=ajax
-
silent assassin
- Forum Newbie
- Posts: 13
- Joined: Mon Feb 27, 2006 6:53 pm
Explain please? I'm really needing help on this and I haven't been able to find anything else. Also, I don't know much about javascript period, so I'm somewhat in the dark. Any examples, suggestions, anything?\feyd wrote:yeah, it's javascript.. and it doesn't require ajax.
hint: new Date()
Thanks again
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
The Date object has the power to tell lots of information about dates and times..
http://devguru.com/technologies/javascript/10585.asp
http://devguru.com/technologies/javascript/10585.asp
-
silent assassin
- Forum Newbie
- Posts: 13
- Joined: Mon Feb 27, 2006 6:53 pm
hmmm....i'm not sure you guys are getting what im asking. I understand about the date object. My problem is, how do i make the second field populate without submitting a form or reloading the page? The links I presented before
http://www.nvidia.com/content/drivers/drivers.asp doesnt' seem to reload the page or anything. I know I can get the maxdays in a month using date(), but how do i make it 1)see whichi month I'm selecting without submitting/reloading the page and 2) get that data without submitting/reloading the page?
http://www.nvidia.com/content/drivers/drivers.asp doesnt' seem to reload the page or anything. I know I can get the maxdays in a month using date(), but how do i make it 1)see whichi month I'm selecting without submitting/reloading the page and 2) get that data without submitting/reloading the page?
-
silent assassin
- Forum Newbie
- Posts: 13
- Joined: Mon Feb 27, 2006 6:53 pm
-
silent assassin
- Forum Newbie
- Posts: 13
- Joined: Mon Feb 27, 2006 6:53 pm
feyd wrote:use the onchange event of the <select> you can get the value via the options array (a property of the object)
Sorry to sound like a completely clueless fool, but what? You're talking about the value for the individual options, right? Ok, so...how? Its my understanding that onchange triggers a javascript event, correct? How to do that in javascript?
Another quickie, is it possible for the onchange to trigger a php function that will populate the information instead?
Take a look at this article at devshed in which an inventory system is build which uses the functionality you describe ( if I understand you well). Make the first selection of a dropdown, and the second one is filled with the relevant choices ffor that first selection.