function formv(frm){
alert(frm.username.value);
document.myform.submit();
}
<form action="http://localhost/CI/index.php/scontr/logs" method="post" name="myform">
<fieldset>
<table>
<tr>
<td>UserID:</td>
<td><input type="text" name="username" maxlength="30" value="" /></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="password" maxlength="30" value="" /></td>
</tr>
<tr><td>
<select name="myselect">
<option value="one" >Teacher</option>
<option value="two" >Student</option>
</select></td>
</tr>
<tr>
<td colspan="2"><input type="button" name="submit" onclick="formv(this.form)" value="Login" /></td>
</tr>
Can anyone tell me why the above form is not being posted in the following address. The alert box is shown, but then nothing happens. It remains in the same page
You need to rename your submit button to something else since
document.myform.submitnow references the button and not the submit action.change
to