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 |
Can you assign an anonymous function to a variable and pass it as an argument to another function?
What are different types of popup boxes available in javascript?
What is the difference of "settimeout" function and setinterval functions in javascript
Can an anonymous function be assigned to a variable?
Which built-in method removes the last element from an array and returns that element?
How to detect the OS on the client machine in JavaScript?
How can you get the total number of arguments passed to a function?
Do you have to declare variables in javascript?
Are Attributes and Property the same?
Is javascript safe to download?
Why we use java script when java also supports validation?
Where do I put javascript in html?