show the date in textbox when we select item (items like--
today,yesterday,lastweek,lastmonth,lastyear) from
dropdownlist using javascript?



show the date in textbox when we select item (items like-- today,yesterday,lastweek,lastmonth,lasty..

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

Post New Answer

More JavaScript Interview Questions

Are java and javascript the same?

0 Answers  


How to open a window with no toolbar, but with the location object?

0 Answers  


What is the purpose of 'this' operator in JavaScript?

0 Answers  


What is null javascript?

0 Answers  


What is decodeuri() function?

0 Answers  






Should you disable javascript?

0 Answers  


What is console.log() and why it is used?

0 Answers  


How to write a script for "select" lists using javascript

0 Answers  


What is double exclamation point?

0 Answers  


how can we create own web browser?

1 Answers   IBM, Infosys,


What is the difference between push() and concat() in javascript?

0 Answers  


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.

1 Answers  


Categories