How can I assign a value to an attribute of a form after the submit button is pressed

I am trying to change the value of a form based on the user selecting null\[code\]<form name="myForm" action="formProcess.php" method='post' onSubmit="return validateForm()"><label for="venue">Venue:</label> <select name="venue"> <option value="http://stackoverflow.com/questions/15909644/null">Please choose</option> <option value="http://stackoverflow.com/questions/15909644/Wynyard Hall">Wynyard Hall</option> <option value="http://stackoverflow.com/questions/15909644/Home">Home</option> <option value="http://stackoverflow.com/questions/15909644/Hallgarth">Hallgarth</option> <option value="http://stackoverflow.com/questions/15909644/Other">Other</option></select>\[/code\]Here is the function\[code\]function validateForm() {var d=document.forms["myForm"]["venue"].value;if (d=="null") {\[/code\]Here is what I want to do.I want to change the value of venue to the users prompt. Something along the lines of:\[code\]var newVenue = prompt("Tell us your venue");venue = newVenue;\[/code\]I know this is wrong but this is my goal. I have used this code I found on here.\[code\]$('#myForm').submit(function() {var txt = $('#venue');txt.val([newVenue]);});}\[/code\]
 
Back
Top