Link to home
Start Free TrialLog in
Avatar of Ben Santiardo
Ben SantiardoFlag for United States of America

asked on

Dynamic Text Using JavaScript?

I am trying to write a portion of my webpage so that when the user enters in a year into a textbox, next to it, the test changes to show the next year.  Ultimately it should liike like a year range, specifically for a school year (ie: 2000 - 2001, 2008 - 2009).  Additionally, I would like to be able to have the "dynamic year" say "[Invalid]" if the user had not typed in a complete year yet.. (ie: 200 - [Invalid]).  Once the user types in 4 digits, then the year range should display properly.

I know VB and and currently writing ASP pages...unfortunately, I am not very familer with JavaScript.  Below is the code I have, but I have no clue how to write the JavaScript part...can anyone help?
<span id="ctl00_MainContent_lblSchoolYear" style="display:inline-block;width:88px;">School-Year Start:</span>
<input name="ctl00$MainContent$txtSchoolYear" type="text" value="0000" maxlength="4" id="ctl00_MainContent_txtSchoolYear" style="width:32px;" />
<span id="ctl00_MainContent_lblSchoolYearRange"> - [EndYear]</span>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of HonorGod
HonorGod
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ben Santiardo

ASKER

PERFECT!!  That was exactly what I needed.
Thank you so much!
You are very welcome.  Thanks for the grade & points.

Good luck & have a great day