What I can see is there is a submit
button in your page, the default action of the the submit button is to submit the form, to prevent it you can return false
from the onclick
event handler.
But what puzzles me is, in this case it has to consistent, the 30 second part does not have any effect here.
Any way try changing the onclick
handler in submit button to
<input type="submit" name="submitbtn" value="Submit" onclick="submitAns('group0','0'); return false;" class="btnSubmit" />