Meaningless Drivel is fun!*
The moose likes HTML, CSS and JavaScript and the fly likes Javascript onchange event Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Javascript onchange event " Watch "Javascript onchange event " New topic
Author

Javascript onchange event

Satish Nair
Greenhorn

Joined: Apr 04, 2012
Posts: 23
Dear All,
I have a form wherein in the option list i have displayed some countries. What i want is when i click on a particular country the date picker (ie date range) should get displayed .Kindly help
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Sure, we can help. But you have to tell us what you need help with. From your post it isn't possible to guess what your problem is.

So, what have you done so far? Do you have some code which doesn't work right? Show us what you have and ask a question about that.
Satish Nair
Greenhorn

Joined: Apr 04, 2012
Posts: 23
<form method="get" id="form1" name="form1">
<select name="sel" onchange="">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</form>

<script type='text/javascript'>
$(function() {
$('#calendar').fullCalendar({
theme: true,
header: {
left: '',
center: '',
right: ''
},
defaultView: 'agendaDay',
editable: false,
events: "../fullcalendar/JSONcreator"
});
$('#datepicker').datepicker({
inline: true,
onSelect: function(dateText, inst) {
var d = new Date(dateText);
$('#calendar').fullCalendar('gotoDate', d);
}
});
})
</script>

Here i have a date function i want the above function to be called when a drop down item is selected
Keith Wood
Author
Ranch Hand

Joined: Aug 28, 2012
Posts: 38

Is the datepicker attached to a div (inline) or an input field (popup)? If the former you could do something like this:



BTW, the jQuery UI datepicker doesn't allow the selection of a date range.


Author of the upcoming "Extending jQuery" book from Manning.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Javascript onchange event