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 |
why array is called the collection of similar datatypes?
What is the use of decodeuri() and encodeuri()?
Is function a data type in javascript?
What applications use javascript?
What is difference between promise and callback?
How to write html code dynamically using JavaScript?
List some features of javascript.
Example of using regular expressions for syntax checking in javascript?
What is the difference between arrow function and normal function?
Is javascript hard to learn?
What is the default data type in javascript?
How are object properties assigned?