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 |
How to access an external javascript file that is stored externally and not embedded?
What does the following statement declares?
How to write a comment in javascript?
Can you assign a anonymous function to a variable?
Why is javascript used for web pages?
What is the use of a set object in javascript?
What are the predefined functions in javascript?
How to validate a form in javascript?
What is Minification
How do you send a message to the browser in JavaScript?
How to set the cursor to wait?
What do “1”+2+4 evaluate to?