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 is the importance of <script> tag?
What is spread operator react?
What is the difference between write and writeln in javascript?
What value does prompt() return if the user clicked the cancel button?
How to handle event handlers?
What’s a way to append a value to an array?
How about 3+5+"8"?
What are the problems associated with using javascript, and are there javascript techniques that you discourage?
what is onfocus and onblur events in java script?
What are the distinct types of error name values?
How to you change the title of the page by javascript?
How to convert json string to object?