473,607 Members | 2,659 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

submit + enter button - same issue but different problem

I have TWO submit buttons of type IMAGE on my asp form. This renders as
<input type="image">.

I need to be able to eble the ENTER button for both buttons. Yes, I know
that for the input type image, the submit happens automatically to the
server. Heres my problem:

I have two event handlers for both these buttons as stated below:

BUTTON 1:
-------------
private void formApplySubmit _Click(object sender,
System.Web.UI.I mageClickEventA rgs e)
{
if (Page.IsValid)
{
formApplySubmit .Visible = false;
formGoMainSubmi t.Visible = true;
}
}

BUTTON 2:
-------------
private void formGoMainSubmi t_Click(object sender,
System.Web.UI.I mageClickEventA rgs e)
{
if (Page.IsValid)
{
Server.Transfer (NEXT_PAGE);
}
}
SO you see whats happening? One button is hidden and then the other comes in
focus. I need to enable the enter key for both these buttons AND fire these
same events directly depending on which button is visible. Id rather not use
third party controls and I have loads of form elements on my page which are
not all text boxes. They are radio buttons, drop downs etc etc which have
their own events firing sometimes.

Thanks,
Girish


Nov 18 '05 #1
5 1923
Hi Girish,

Thanks for posting in the community!
From your description, you have two buttons on a certain ASP.NET web page.
And when one button is visible
the other is not visible. However, you'd like to set both the two buttons
as default "enter" key button depend on
which one is visible, yes?

As for this question, I think you can use a <input type=hidden ..> html
element to store the button's id (which is currently visible). Since we can
use javascript to invoke the default button, when user press "enter" key,
we dynamically invoke the certain button via the <input type=hidden ..>'s
value. Below is a sample page which applying the above means, please refer
to it if you feel anything unclear:

--------------------------aspx page------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>PostBack </title>
<meta name="GENERATOR " Content="Micros oft Visual Studio .NET 7.1">
<meta name="CODE_LANG UAGE" Content="C#">
<meta name="vs_defaul tClientScript" content="JavaSc ript">
<meta name="vs_target Schema"
content="http://schemas.microso ft.com/intellisense/ie5">
<script language="javas cript">
function doEnter()
{
var btn = document.getEle mentById("hdDef aultButton").va lue;

if ((event.which && event.which == 13) || (event.keyCode &&
event.keyCode == 13))
{
document.all(bt n).click();
return false;
}
else
{
return true;
}
}

</script>
</HEAD>
<body onkeydown="doEn ter()">
<form id="Form1" method="post" runat="server">
<input type="hidden" runat="server" id="hdDefaultBu tton"
name="hdDefault Button" value="formAppl ySubmit">
<table width="500" align="center">
<tr>
<td>
<asp:TextBox id="TextBox1" runat="server"> </asp:TextBox>
<asp:TextBox id="TextBox2" runat="server"> </asp:TextBox>
</td>
<td>
<asp:Button id="formApplySu bmit" runat="server"
Text="formApply Submit"></asp:Button>
</td>
</tr>
<tr>
<td>
<asp:TextBox id="TextBox3" runat="server"> </asp:TextBox>
<asp:TextBox id="TextBox4" runat="server"> </asp:TextBox>
</td>
<td>
<asp:Button id="formGoMainS ubmit" runat="server"
Text="formGoMai nSubmit" Visible="False" ></asp:Button>
</td>
</tr>
</table>
</form>
</body>
</HTML>
-------------------------------------code behind page
class----------------------
public class MultiDefaultBut ton : System.Web.UI.P age
{
protected System.Web.UI.W ebControls.Butt on formApplySubmit ;
protected System.Web.UI.W ebControls.Butt on formGoMainSubmi t;
protected System.Web.UI.W ebControls.Text Box TextBox1;
protected System.Web.UI.W ebControls.Text Box TextBox2;
protected System.Web.UI.W ebControls.Text Box TextBox3;
protected System.Web.UI.W ebControls.Text Box TextBox4;
protected System.Web.UI.H tmlControls.Htm lInputHidden hdDefaultButton ;

private void Page_Load(objec t sender, System.EventArg s e)
{
TextBox1.Attrib utes.Add("onkey down","doEnter( )");
TextBox2.Attrib utes.Add("onkey down","doEnter( )");
TextBox3.Attrib utes.Add("onkey down","doEnter( )");
TextBox4.Attrib utes.Add("onkey down","doEnter( )");
}

#region Web Form Designer generated code
override protected void OnInit(EventArg s e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeCompo nent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeCompo nent()
{
this.formApplyS ubmit.Click += new
System.EventHan dler(this.formA pplySubmit_Clic k);
this.formGoMain Submit.Click += new
System.EventHan dler(this.formG oMainSubmit_Cli ck);
this.Load += new System.EventHan dler(this.Page_ Load);

}
#endregion

private void formApplySubmit _Click(object sender, System.EventArg s e)
{
formApplySubmit .Visible = false;
formGoMainSubmi t.Visible = true;
this.hdDefaultB utton.Value = "formGoMainSubm it";
Response.Write( "<br>Button formApplySubmit is clicked at: " +
DateTime.Now.To LongTimeString( ));
}

private void formGoMainSubmi t_Click(object sender, System.EventArg s e)
{
formApplySubmit .Visible = true;
formGoMainSubmi t.Visible = false;
this.hdDefaultB utton.Value = "formApplySubmi t";
Response.Write( "<br>Button formGoMainSubmi t is clicked at: " +
DateTime.Now.To LongTimeString( ));
}
}
----------------------------------------------------------------------------
----------------------

Hope this helps.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #2
Would this work for netscape as well? dosent seem to be working.

thanks,
girish
"Steven Cheng[MSFT]" <v-******@online.m icrosoft.com> wrote in message
news:6y******** *****@cpmsftngx a06.phx.gbl...
Hi Girish,

Thanks for posting in the community!
From your description, you have two buttons on a certain ASP.NET web page.
And when one button is visible
the other is not visible. However, you'd like to set both the two buttons
as default "enter" key button depend on
which one is visible, yes?

As for this question, I think you can use a <input type=hidden ..> html
element to store the button's id (which is currently visible). Since we can use javascript to invoke the default button, when user press "enter" key,
we dynamically invoke the certain button via the <input type=hidden ..>'s
value. Below is a sample page which applying the above means, please refer
to it if you feel anything unclear:

--------------------------aspx page------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>PostBack </title>
<meta name="GENERATOR " Content="Micros oft Visual Studio .NET 7.1">
<meta name="CODE_LANG UAGE" Content="C#">
<meta name="vs_defaul tClientScript" content="JavaSc ript">
<meta name="vs_target Schema"
content="http://schemas.microso ft.com/intellisense/ie5">
<script language="javas cript">
function doEnter()
{
var btn = document.getEle mentById("hdDef aultButton").va lue;

if ((event.which && event.which == 13) || (event.keyCode &&
event.keyCode == 13))
{
document.all(bt n).click();
return false;
}
else
{
return true;
}
}

</script>
</HEAD>
<body onkeydown="doEn ter()">
<form id="Form1" method="post" runat="server">
<input type="hidden" runat="server" id="hdDefaultBu tton"
name="hdDefault Button" value="formAppl ySubmit">
<table width="500" align="center">
<tr>
<td>
<asp:TextBox id="TextBox1" runat="server"> </asp:TextBox>
<asp:TextBox id="TextBox2" runat="server"> </asp:TextBox>
</td>
<td>
<asp:Button id="formApplySu bmit" runat="server"
Text="formApply Submit"></asp:Button>
</td>
</tr>
<tr>
<td>
<asp:TextBox id="TextBox3" runat="server"> </asp:TextBox>
<asp:TextBox id="TextBox4" runat="server"> </asp:TextBox>
</td>
<td>
<asp:Button id="formGoMainS ubmit" runat="server"
Text="formGoMai nSubmit" Visible="False" ></asp:Button>
</td>
</tr>
</table>
</form>
</body>
</HTML>
-------------------------------------code behind page
class----------------------
public class MultiDefaultBut ton : System.Web.UI.P age
{
protected System.Web.UI.W ebControls.Butt on formApplySubmit ;
protected System.Web.UI.W ebControls.Butt on formGoMainSubmi t;
protected System.Web.UI.W ebControls.Text Box TextBox1;
protected System.Web.UI.W ebControls.Text Box TextBox2;
protected System.Web.UI.W ebControls.Text Box TextBox3;
protected System.Web.UI.W ebControls.Text Box TextBox4;
protected System.Web.UI.H tmlControls.Htm lInputHidden hdDefaultButton ;

private void Page_Load(objec t sender, System.EventArg s e)
{
TextBox1.Attrib utes.Add("onkey down","doEnter( )");
TextBox2.Attrib utes.Add("onkey down","doEnter( )");
TextBox3.Attrib utes.Add("onkey down","doEnter( )");
TextBox4.Attrib utes.Add("onkey down","doEnter( )");
}

#region Web Form Designer generated code
override protected void OnInit(EventArg s e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeCompo nent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeCompo nent()
{
this.formApplyS ubmit.Click += new
System.EventHan dler(this.formA pplySubmit_Clic k);
this.formGoMain Submit.Click += new
System.EventHan dler(this.formG oMainSubmit_Cli ck);
this.Load += new System.EventHan dler(this.Page_ Load);

}
#endregion

private void formApplySubmit _Click(object sender, System.EventArg s e)
{
formApplySubmit .Visible = false;
formGoMainSubmi t.Visible = true;
this.hdDefaultB utton.Value = "formGoMainSubm it";
Response.Write( "<br>Button formApplySubmit is clicked at: " +
DateTime.Now.To LongTimeString( ));
}

private void formGoMainSubmi t_Click(object sender, System.EventArg s e)
{
formApplySubmit .Visible = true;
formGoMainSubmi t.Visible = false;
this.hdDefaultB utton.Value = "formApplySubmi t";
Response.Write( "<br>Button formGoMainSubmi t is clicked at: " +
DateTime.Now.To LongTimeString( ));
}
}
-------------------------------------------------------------------------- -- ----------------------

Hope this helps.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #3

I got this far with netscape - but it does not like document.all

function Document_onKeyD own(e)
{
var nKey = -1;
var btn = document.getEle mentById("hdDef aultButton").va lue;

if (e && e.which)
nKey = e.which; // NS4 & NS6
else if (window.event && window.event.ke yCode)
nKey = window.event.ke yCode; // IE

if (nKey == 13)
{
alert("enter pressed");
eval(btn).submi t();
return true;
}

alert("not pressed");
return false;
}
"Girish" <gb****@tietron ixinc.com> wrote in message
news:uY******** ******@TK2MSFTN GP12.phx.gbl...
Would this work for netscape as well? dosent seem to be working.

thanks,
girish
"Steven Cheng[MSFT]" <v-******@online.m icrosoft.com> wrote in message
news:6y******** *****@cpmsftngx a06.phx.gbl...
Hi Girish,

Thanks for posting in the community!
From your description, you have two buttons on a certain ASP.NET web page. And when one button is visible
the other is not visible. However, you'd like to set both the two buttons as default "enter" key button depend on
which one is visible, yes?

As for this question, I think you can use a <input type=hidden ..> html
element to store the button's id (which is currently visible). Since we

can
use javascript to invoke the default button, when user press "enter" key, we dynamically invoke the certain button via the <input type=hidden ...>'s value. Below is a sample page which applying the above means, please refer to it if you feel anything unclear:

--------------------------aspx page------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>PostBack </title>
<meta name="GENERATOR " Content="Micros oft Visual Studio .NET 7.1">
<meta name="CODE_LANG UAGE" Content="C#">
<meta name="vs_defaul tClientScript" content="JavaSc ript">
<meta name="vs_target Schema"
content="http://schemas.microso ft.com/intellisense/ie5">
<script language="javas cript">
function doEnter()
{
var btn = document.getEle mentById("hdDef aultButton").va lue;

if ((event.which && event.which == 13) || (event.keyCode &&
event.keyCode == 13))
{
document.all(bt n).click();
return false;
}
else
{
return true;
}
}

</script>
</HEAD>
<body onkeydown="doEn ter()">
<form id="Form1" method="post" runat="server">
<input type="hidden" runat="server" id="hdDefaultBu tton"
name="hdDefault Button" value="formAppl ySubmit">
<table width="500" align="center">
<tr>
<td>
<asp:TextBox id="TextBox1" runat="server"> </asp:TextBox>
<asp:TextBox id="TextBox2" runat="server"> </asp:TextBox>
</td>
<td>
<asp:Button id="formApplySu bmit" runat="server"
Text="formApply Submit"></asp:Button>
</td>
</tr>
<tr>
<td>
<asp:TextBox id="TextBox3" runat="server"> </asp:TextBox>
<asp:TextBox id="TextBox4" runat="server"> </asp:TextBox>
</td>
<td>
<asp:Button id="formGoMainS ubmit" runat="server"
Text="formGoMai nSubmit" Visible="False" ></asp:Button>
</td>
</tr>
</table>
</form>
</body>
</HTML>
-------------------------------------code behind page
class----------------------
public class MultiDefaultBut ton : System.Web.UI.P age
{
protected System.Web.UI.W ebControls.Butt on formApplySubmit ;
protected System.Web.UI.W ebControls.Butt on formGoMainSubmi t;
protected System.Web.UI.W ebControls.Text Box TextBox1;
protected System.Web.UI.W ebControls.Text Box TextBox2;
protected System.Web.UI.W ebControls.Text Box TextBox3;
protected System.Web.UI.W ebControls.Text Box TextBox4;
protected System.Web.UI.H tmlControls.Htm lInputHidden hdDefaultButton ;

private void Page_Load(objec t sender, System.EventArg s e)
{
TextBox1.Attrib utes.Add("onkey down","doEnter( )");
TextBox2.Attrib utes.Add("onkey down","doEnter( )");
TextBox3.Attrib utes.Add("onkey down","doEnter( )");
TextBox4.Attrib utes.Add("onkey down","doEnter( )");
}

#region Web Form Designer generated code
override protected void OnInit(EventArg s e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeCompo nent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeCompo nent()
{
this.formApplyS ubmit.Click += new
System.EventHan dler(this.formA pplySubmit_Clic k);
this.formGoMain Submit.Click += new
System.EventHan dler(this.formG oMainSubmit_Cli ck);
this.Load += new System.EventHan dler(this.Page_ Load);

}
#endregion

private void formApplySubmit _Click(object sender, System.EventArg s e)
{
formApplySubmit .Visible = false;
formGoMainSubmi t.Visible = true;
this.hdDefaultB utton.Value = "formGoMainSubm it";
Response.Write( "<br>Button formApplySubmit is clicked at: " +
DateTime.Now.To LongTimeString( ));
}

private void formGoMainSubmi t_Click(object sender, System.EventArg s e)
{
formApplySubmit .Visible = true;
formGoMainSubmi t.Visible = false;
this.hdDefaultB utton.Value = "formApplySubmi t";
Response.Write( "<br>Button formGoMainSubmi t is clicked at: " +
DateTime.Now.To LongTimeString( ));
}
}


--------------------------------------------------------------------------
--
----------------------

Hope this helps.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx


Nov 18 '05 #4
figured it out. Thanks for your help.
Girish

<script language="javas cript">
function Document_onKeyD own(e)
{
var nKey = -1;
var btn = document.getEle mentById("hdDef aultButton").va lue;

if (e && e.which)
nKey = e.which; // NS4 & NS6
else if (window.event && window.event.ke yCode)
nKey = window.event.ke yCode; // IE

if (nKey == 13)
{
document.getEle mentById(btn).c lick();
return true;
}

return false;
}

</script>
"Girish" <gb****@tietron ixinc.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..

I got this far with netscape - but it does not like document.all

function Document_onKeyD own(e)
{
var nKey = -1;
var btn = document.getEle mentById("hdDef aultButton").va lue;

if (e && e.which)
nKey = e.which; // NS4 & NS6
else if (window.event && window.event.ke yCode)
nKey = window.event.ke yCode; // IE

if (nKey == 13)
{
alert("enter pressed");
eval(btn).submi t();
return true;
}

alert("not pressed");
return false;
}
"Girish" <gb****@tietron ixinc.com> wrote in message
news:uY******** ******@TK2MSFTN GP12.phx.gbl...
Would this work for netscape as well? dosent seem to be working.

thanks,
girish
"Steven Cheng[MSFT]" <v-******@online.m icrosoft.com> wrote in message
news:6y******** *****@cpmsftngx a06.phx.gbl...
Hi Girish,

Thanks for posting in the community!
From your description, you have two buttons on a certain ASP.NET web page. And when one button is visible
the other is not visible. However, you'd like to set both the two buttons as default "enter" key button depend on
which one is visible, yes?

As for this question, I think you can use a <input type=hidden ..> html element to store the button's id (which is currently visible). Since
we
can
use javascript to invoke the default button, when user press "enter"

key, we dynamically invoke the certain button via the <input type=hidden ..>'s value. Below is a sample page which applying the above means, please refer to it if you feel anything unclear:

--------------------------aspx page------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>PostBack </title>
<meta name="GENERATOR " Content="Micros oft Visual Studio .NET 7.1">
<meta name="CODE_LANG UAGE" Content="C#">
<meta name="vs_defaul tClientScript" content="JavaSc ript">
<meta name="vs_target Schema"
content="http://schemas.microso ft.com/intellisense/ie5">
<script language="javas cript">
function doEnter()
{
var btn = document.getEle mentById("hdDef aultButton").va lue;

if ((event.which && event.which == 13) || (event.keyCode &&
event.keyCode == 13))
{
document.all(bt n).click();
return false;
}
else
{
return true;
}
}

</script>
</HEAD>
<body onkeydown="doEn ter()">
<form id="Form1" method="post" runat="server">
<input type="hidden" runat="server" id="hdDefaultBu tton"
name="hdDefault Button" value="formAppl ySubmit">
<table width="500" align="center">
<tr>
<td>
<asp:TextBox id="TextBox1" runat="server"> </asp:TextBox>
<asp:TextBox id="TextBox2" runat="server"> </asp:TextBox>
</td>
<td>
<asp:Button id="formApplySu bmit" runat="server"
Text="formApply Submit"></asp:Button>
</td>
</tr>
<tr>
<td>
<asp:TextBox id="TextBox3" runat="server"> </asp:TextBox>
<asp:TextBox id="TextBox4" runat="server"> </asp:TextBox>
</td>
<td>
<asp:Button id="formGoMainS ubmit" runat="server"
Text="formGoMai nSubmit" Visible="False" ></asp:Button>
</td>
</tr>
</table>
</form>
</body>
</HTML>
-------------------------------------code behind page
class----------------------
public class MultiDefaultBut ton : System.Web.UI.P age
{
protected System.Web.UI.W ebControls.Butt on formApplySubmit ;
protected System.Web.UI.W ebControls.Butt on formGoMainSubmi t;
protected System.Web.UI.W ebControls.Text Box TextBox1;
protected System.Web.UI.W ebControls.Text Box TextBox2;
protected System.Web.UI.W ebControls.Text Box TextBox3;
protected System.Web.UI.W ebControls.Text Box TextBox4;
protected System.Web.UI.H tmlControls.Htm lInputHidden hdDefaultButton ;

private void Page_Load(objec t sender, System.EventArg s e)
{
TextBox1.Attrib utes.Add("onkey down","doEnter( )");
TextBox2.Attrib utes.Add("onkey down","doEnter( )");
TextBox3.Attrib utes.Add("onkey down","doEnter( )");
TextBox4.Attrib utes.Add("onkey down","doEnter( )");
}

#region Web Form Designer generated code
override protected void OnInit(EventArg s e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeCompo nent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeCompo nent()
{
this.formApplyS ubmit.Click += new
System.EventHan dler(this.formA pplySubmit_Clic k);
this.formGoMain Submit.Click += new
System.EventHan dler(this.formG oMainSubmit_Cli ck);
this.Load += new System.EventHan dler(this.Page_ Load);

}
#endregion

private void formApplySubmit _Click(object sender, System.EventArg s e)
{
formApplySubmit .Visible = false;
formGoMainSubmi t.Visible = true;
this.hdDefaultB utton.Value = "formGoMainSubm it";
Response.Write( "<br>Button formApplySubmit is clicked at: " +
DateTime.Now.To LongTimeString( ));
}

private void formGoMainSubmi t_Click(object sender, System.EventArg s e)
{
formApplySubmit .Visible = true;
formGoMainSubmi t.Visible = false;
this.hdDefaultB utton.Value = "formApplySubmi t";
Response.Write( "<br>Button formGoMainSubmi t is clicked at: " +
DateTime.Now.To LongTimeString( ));
}
}


--------------------------------------------------------------------------
--
----------------------

Hope this helps.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx



Nov 18 '05 #5
Hi Girish,

Thanks for your response. Actually I haven't considered that you'll apply
the code on netscape browser. As you've found the "document.a ll" is not
supported in netscape, however the "document.getEl ementById()" has the same
function and is supported by both IE and netscape. Anyway, I'm glad that
you've figured it out finally and thanks again for posting in community.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
9584
by: ivanhoe | last post by:
All articles and tutorials I've seen on subject of forms say that if there's name and value for submit button(input tag with type="submit"), they'll get submitted along with the rest of the form... but I've just noticed (after debugging my perl script for quite a while :/ ) that it is true only when user clicks on submit, and if form is submitted via hitting enter you don't get name=value for submit buttton...
15
6564
by: M Smith | last post by:
I have a form I want to submit to itself. I want to be able to type in a list of numbers and submit the form and have that list show up on the same form under the text box I typed them into and the buttons. The problem is when I post a form to itself, the Enter key will not submit the form, it only clears the contents of the text box. The only way I can submit is to click the submit button. Here is a simplified version of my code that I...
6
3095
by: CJM | last post by:
Can somebody clarify if/how/when a simple form is submitted when the <Enter> key is pressed? As I understood it, if you have a form with a single submit button, if enter is pressed, the form should be submitted as if the button is pressed. Is this correct? Does this behaviour vary across browsers? Chris
3
10139
by: Adam | last post by:
Hey guys, I've decided to stop banging my head against the wall and just ask you guys for the answer. I can't seem to find it. I have a form in which I have multiple submit buttons; only, I'm using button tags, not input tags to do it. It seems that IE6 is treating all the button elements as being successful on submit. This is, to say the least, surprising since the Spec is pretty clear that it should.
2
3110
by: 23s | last post by:
My site's login page has a form w/ 2 textboxes and a submit button. If I'm in either of those textboxes (i.e., either one of the textboxes has focus), in any given browser, hitting "enter" on my keyboard submits the form. Server side, I handle the click event of the submit button. This is the expected behavior, and this is the behavior irrespective of what browser I use on the login page. However... I have different page that is an...
10
3027
by: Perry van Kuppeveld | last post by:
Hi, I have a problem with formatting a table including text fields wich can contain up to 255 chars. I need a table with 3 columns: - First column 50 % over the with a rowspan of the total number of rows. - Second column 25 %, no rowspan - Third column 25 %, no rowspan
7
2065
by: Bjorn Sagbakken | last post by:
Hello. There maybe an simple answer to this, but sometimes one get a strange blindness when working intensely on one single problem. I'm using ASP.NET 2003, building pages that include 3 user controls (banner, top-menu and sub-menu). The top-menu contains like five asp:buttons. Further down the form there is search field with another asp:button. And I naturally want this button to act as submit button in the sense that when
12
6929
by: Daniel Klein | last post by:
I'm pretty new at php and web stuff so please be gentle with me. I'm trying to get a form to submit when the user presses the Enter key. I do not want to use javascript. I've googled this to death and cant find the answer (only hints), except on the 'Experts Exhange' page and you have to pay to get the answer :-( Why is this such a secret in the open source world we live in? Daniel Klein
0
2776
by: thersitz | last post by:
Hi, Using aspnet3.5,VStudio 2008, VB 1.) I have a set of pages, with a search text box button within a userControl that searches across our websites and is registered in a masterpage. 2) Also within that set of pages, I have a second, distinct seach box and button that searches a specific database that is within an asp:content area
0
8049
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7985
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8128
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
5997
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3953
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4013
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2461
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1574
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1316
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.