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 |
Are java and javascript the same?
How to open a window with no toolbar, but with the location object?
What is the purpose of 'this' operator in JavaScript?
What is null javascript?
What is decodeuri() function?
Should you disable javascript?
What is console.log() and why it is used?
How to write a script for "select" lists using javascript
What is double exclamation point?
how can we create own web browser?
What is the difference between push() and concat() in javascript?
write a programme to solve a formula for compound interest using html tags. I want to know how a formula containing degree (raise to the power) can be solved.