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
name any two javascript functions which are used to convert nonnumeric values into numbers?
How can I request data from the server without reloading the page in the browser?
How to test for bad numbers using javascript?
What is js injection?
How can we establish connection with java and sql server?
What are math constants and functions using javascript?
In which location cookies are stored on the hard disk?
What is let keyword in typescript?
Write the point of difference between web-garden and a web-farm?
What is a closure and why are they so useful to us?
How to force a page to go to another page using javascript ?
Is javascript a highly secure scripting language?
What is a frontend framework?
How to call a function in every x seconds in javascript?
Between JavaScript and an ASP script, which is faster?