My website was designed using a CSS/HTML framework that has been seamlessly integrated into an ASP.NET site.
Within a ContentPlaceHolder, I have implemented a basic login form. The unique aspect is that I am utilizing the onclick event of an image to submit the form. While this method typically functions smoothly, I am currently encountering an issue.
<div id="login">
<form action="index.aspx" method="post" id="nothingForm" name="nothingForm">
</form>
<form action="https://google.com.au" method="post" id="loginform" name="loginform">
<input type="text" name="uname" value="username" onfocus="if(!this._haschanged){this.value=''};this._haschanged=true;"/>
<input type="password" name="pword" value="password" onfocus="if(!this._haschanged){this.value=''};this._haschanged=true;"/>
</form>
<br /><img src="images/login.gif" alt="" onclick="document['loginform'].submit()" /> </div>
To make the onclick="document['loginform'].submit()" function properly, I had to insert another form before the actual form. Ideally, this workaround should not be necessary, but unfortunately, I could not find any solutions for this issue online.
Has anyone else encountered a similar situation like this?