Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Javascript onchange event

 
Satish Nair
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Pie
Posts: 20177
25
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<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
Posts: 38
jQuery
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic