show the date in textbox when we select item (items like--
today,yesterday,lastweek,lastmonth,lastyear) from
dropdownlist using javascript?
Answer Posted / 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 |
Post New Answer View All Answers
How to get checkbox status whether it is checked or not?
How to detect browser name using JavaScript?
What is enum in javascript?
What are the variables in javascript?
What are the main uses of javascript?
I am providing the Online& class room training on Worksoft Certify for SAP/HTML/JAVA using real time scenarios in a real time environment for a real time project, If any one is interested please get in touch with me on aimansaud@gmail.com
Which built-in method adds one or more elements to the end of an array and returns the new length of the array?
What is the statement to enable strict mode in javascript quiz?
What is a function constructor?
What does triple dot mean?
What is the difference between innerhtml & innertext?
What is use strict in javascript?
Can we learn javascript without knowing java?
What is isnan in javascript?
What is callback?