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
connect() succeeds but accept() does not?
Please help me with this problem. I'm working on a time-sensitive project where I'm using TCP sockets. I've got this problem where most of the time a connection cannot be made.
Multidimensional array problems in $_POST
I'm having trouble with a three-dimensional $_POST array. It starts as a two-dimensional array on this side:Code: <html> <head>
Adding delete feature to my forum
Hello I am currently trying to add a delete feature to my forum. I believe I have everything built right but I am having some problems when debugging. I do not have PHP Designer 2008 and I am using
Problem with PHP code- simple contact form
I'm relativily new to PHP; I know HTML and CSS stuff but I have a problem- I have a contact form with PHP code in it- grabbed it from the sitemaster website. Unfortunately my form isn't sending any
need help in mysql_num_rows()
please tell me what i am doing wrong in this query. it displays this errorCode: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in D:\wamp\www\dynamic\quiz2.php on
strtotime issue
Hey all,I'm playing around with some code, and basically the idea is:Person changes their profileI fetch some XML that has a unix timestamp for the time the person changed their profile, so it'll keep
.htpasswd Registration Form
Hi,I wanted to make an htpasswd registration form.I found this code on the internet but have no idea how to use it.Can anyone help?<?php// Register Userfunction regUser() { $filename
RTF fomatting to email content
Im trying to sen an email with content is picked up from a rtf-file (file_get_contents('*.rtf'). Mail is sent correctly, but the formatting of the content includes rtf formatting like:
newbie error
what is wrong with this code ? <html><body><?php$conn=odbc_connect('Towel','','');if (!$conn) {exit("Connection Failed: " . $conn);}$sql="SELECT *
pagination numbering pattern
Hello,I have following code which works great for pagination. but i have small issue now.Now the output is coming like this Quotemypage.php?page=2I want it like thisQuotemypage.php/2code-Code: