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


Please Help Members By Posting Answers For Below Questions

How to get checkbox status whether it is checked or not?

596


How to detect browser name using JavaScript?

605


What is enum in javascript?

692


What are the variables in javascript?

655


What are the main uses of javascript?

568






I am providing the Online& class room training on Worksoft Certify for SAP/HTML/JAVA using real time scenarios in a real time environment for a real time project, If any one is interested please get in touch with me on aimansaud@gmail.com

1128


Which built-in method adds one or more elements to the end of an array and returns the new length of the array?

912


What is the statement to enable strict mode in javascript quiz?

575


What is a function constructor?

556


What does triple dot mean?

624


What is the difference between innerhtml & innertext?

554


What is use strict in javascript?

572


Can we learn javascript without knowing java?

551


What is isnan in javascript?

612


What is callback?

684