show the date in textbox when we select item (items like--
today,yesterday,lastweek,lastmonth,lastyear) from
dropdownlist using javascript?
Answer / syed ahmed jawwad
<!--- Include Jquery Script, source www.jquery.com--->
<select id="dayType" name="dayType" onchange="showFields()">
<option>Today</option>
<option>Yesterday</option>
<option>Last Week</option>
<option>Last Month</option>
<option>Voucher Number</option>
</select>
<input type="text" id="dateValue" name="dateValue">
<script type="text/javascript">
function showFields()
{
if(jQuery('#dayType').val()=='Today' ||
jQuery('#dayType').val()=='Yesterday')
{
jQuery('#dateValue').datepicker({changemonth:
true, changeyear: true, dateformat:'mm/dd/yy'});
}else jQuery('#dateValue').datepicker('destroy');
}
</script>
Is This Answer Correct ? | 3 Yes | 0 No |
What are all the types of Pop up boxes available in JavaScript?
What is an anonymous function in JavaScript?
What are the methods involved in javascript?
How can a page be forced to load another page in javascript?
Auto insurance project..How to explain project in interviews.Using Automation tool (selenium).
what is the different between html and java?why the java is required in internet?
How to use one javascript function for multiple input fields?
Write the code to maximize an image using javaScript?
List few advantages of using javascript?
What is the dollar sign in javascript?
What is the difference between java & javascript?
Does javascript support multidimensional arrays ?