Hi,One of the most annoying things in developing web pages is handling the "Enter key" for form submission. Enter key has been the favourite way users like to submit forms. Though we provide Buttons to click on, the easiest and intuitive way is that, I can enter some text, make some changes and then hit "Enter" to accomplish my submission.
"Enter" Key is handled in a little tricky way by uplevel browsers like Internet Explorer, when it comes to ASP.NET.
If there is a single Textbox and single button, then it becomes straight forward, the button is submitted. However, the event code doesnt get executed, though the page postsback.If there are two or more, buttons, then it takes up the first button as the default button. However, it still doesnt execute the event handler but just refreshes the page.You can supress the Enter key event using Javascript. But this would result in other undesirable effects like, any Enter key in the form i.e. within Text Area or basically where large text is entered, would be disabled.The earlier work around was to associate a javascript function to each Button to verify the that the relevant button is submitted upon Enter key.ASP.NET 2.0 introduces a wonderful work around for this. By simply specifying the "defaultbutton" property to the ID of the
The corresponding, sample events for the button clicks are
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write(Button1.Text);
}
protected void Button2_Click(object sender, EventArgs e)
{
Response.Write(Button2.Text);
}
protected void Button3_Click(object sender, EventArgs e)
{
Response.Write(Button3.Text);
}
protected void Button4_Click(object sender, EventArgs e)
{
Response.Write(Button4.Text);
}
protected void btn1_Click(object sender, EventArgs e)
{
Response.Write(btn1.Text);
}
protected void Button5_Click(object sender, EventArgs e)
{
Response.Write(Button5.Text);
}Once we execute the above functionality, we can notice, the corresponding Buttons' text are displayed when the Enter key is pressed from within a panel and at the form level, it fires the btn1 Button's event.Thanks
CURL XML Request [From C to PHP]
Hi, I need some help converting this into something that will work with PHP.Code:
error help - Dynamic Image
I've been working on making my site less cluttered in the directories and more secure lately. In an attempt to prevent bandwidth theft from other people using images, I decided to switch all my site
COOIS - Saving Object Overview WIP Status layouts
COOIS - Would like to be able to save the layout of an Object Overview - WIP Status report. There is currently NO icons for "choose layout" , "export" or "views" available while in Object Overview.
Storing user data help?
Hey Guys, I'm not use if this question is to broad but I can always give you more information if needed.I have a website where users can login which uses mysql anyway I have a little form asking some
Gridview Not updating in Update Panel
I have a gridview, three dropdown list boxes, and a button on my form. What is displayed in the gridview depends on the values entered in the dropdown list boxes. The button calls a stored procedure
query based on 2 conditions
I want to select if the doc_type is either s OR f but this doesn't work:Code: [Select]$query2 = "SELECT * FROM members WHERE doc_type='s' && doc_type= 'f' ORDER BY
Can you help please? Php file
I have to write this php file to allow users to register their nicknames on nickservFor an IRC server, however it worked fine for a couple of years, I then upgraded from Php4 to Php5 and suddenly
PL/SQL: ORA-00947: not enough values error message
Hi all i am getting Error(25,63): PL/SQL: ORA-00947: not enough values error message when executing following insert statement. I am new to Oracle SPs, so could someone help me to solve the issue.
difference between datetimes
($row['totime']-$row['fromtime'])/60this is giving me 0example of totime and fromtime are:2009-12-26 01:10:05 and 2009-12-26 1:03:01i was thinking that with those values i would end up with something
BAPI BBP_INB_DELIVERY_CREATE - material number missing in delivery
Hi Experts,