Jump to content

select list selected value


garevn

Recommended Posts

I submit this select list through a form, If the chosen number exist then I print an error but the selected value resets. Can I somehow make it remember the selected value?var myDate = new Date();var year = myDate.getFullYear();for(var i = 4; i < 16; i++){document.write('<option value="'+i+'">'+i+'</option>');}When I use Input I use this and it works fine but now I am a bit confused. <?php if (isset($_POST['name'])) echo 'value="'.$_POST['name'].'"';?>
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...