When a person completes filling a form in the site, if the user presses on Enter key in the keyboard,
it should go to submit button by default. Is there any way I can make it happen?
Thanks
When a person completes filling a form in the site, if the user presses on Enter key in the keyboard,
it should go to submit button by default. Is there any way I can make it happen?
Thanks
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
r pPosted Jan 23, 2009, 4:03 AM
Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that
Thanks
Niradhip ChakrabortyPosted Jan 23, 2009, 1:55 AM
This error may occur when one hosts an ASP.NET webpage on a web-garden.
Simple solution (for ASP.NET 2.0 and up): Generate a new machinekey and add it to the web.config.
Try the following URL to generate machinekey:
http://www.aspnetresources.com/tools/keycreator.aspx
r pPosted Jan 22, 2009, 10:27 AM
But, I am getting an error like this:-
Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the
same validationKey and validation algorithm. AutoGenerate cannot be used in a
cluster.
Niradhip ChakrabortyPosted Jan 21, 2009, 4:05 PM
The default configurationenableEventValidation="true"/> to or
hinders changes made on the client to prevent XSS (Cross Site Scripting). If
you don't want this support you can change
set <%@ Page EnableEventValidation="true" %> to <%@ Page
EnableEventValidation="false" %> in the one page you want to allow changes
made to your dropdownlists. Be sure though to check EVERY value on the
server. Remember: ALL INPUT IS EVIL!!!
Now u can check the following code:
ASP.NET 2.0 makes this problems easier and introduce a concept of a "default button". New defaultbutton attribute can be used with
r pPosted Jan 21, 2009, 3:34 AM
When I use
I am getting an error like this:-
Invalid postback or callback argument. Event validation is enabled using
When I used runat="server", it did not work. So, I removed runat="server".
Should I use something else?
Thanks,
Niradhip ChakrabortyPosted Jan 20, 2009, 8:58 AM
We can set Defaultbutton property either in Form or if we've placed a panel than in panel
or if we use panel than
raviPosted Jan 19, 2009, 3:05 PM
r pPosted Jan 19, 2009, 4:06 AM
I created a Javascript function with the code which you have given me.
But, how should I call this?
Where should I call this?
I am using asp.net login control. Suppose the user hits on enter key immediately after entering the username,
it should go to the Submit button, Now, it is not going to the Submit button.
Any idea?
Thanks so much
ArshadPosted Jan 12, 2009, 12:01 AM
function doClick(buttonName,e)
{
var key;
if(window.event)
{
key = window.event.keyCode; //IE
}
else
key = e.which; //firefox
if (key == 13)
{
var btn = document.getElementById(buttonName);
if (btn != null)
{
btn.click();
event.keyCode = 0
}
}
}
Regards
Khan.