Hi,
I have a page where I'm expecting the user to input data in a textbox and then submit that data.
The problem occurs when the user presses Enter after he inputs his data; he expects the form to be submitted but nothing happens. He has to physically click the submit button in order for the page to be sent.
I saw on another forum where the suggestion was to add this to my Page_Load sub:
The button to send the form isn't a submit button - it's just a regular button I added to the design view of my aspx page.
So what I was thinking was that instead of saying "document.form1.submit()", I'd call my btnSubmit_Click subroutine.
I gave it a whirl but nothing happened. My code looked like this:
Can I even call a sub like that?
Any help would be appreciated.
Thanks in advance!
Suzanne
I have a page where I'm expecting the user to input data in a textbox and then submit that data.
The problem occurs when the user presses Enter after he inputs his data; he expects the form to be submitted but nothing happens. He has to physically click the submit button in order for the page to be sent.
I saw on another forum where the suggestion was to add this to my Page_Load sub:
Code:
txtQuantity.Attributes.Add("onKeyUp", "if(window.event.keyCode==13){document.form1.submit();}")
The button to send the form isn't a submit button - it's just a regular button I added to the design view of my aspx page.
So what I was thinking was that instead of saying "document.form1.submit()", I'd call my btnSubmit_Click subroutine.
I gave it a whirl but nothing happened. My code looked like this:
Code:
Dim tempSend as System.Object
Dim tempEvent as System.EventArgs
txtQuantity.Attributes.Add("onKeyUp", "if(window.event.keyCode==13){btnSubmit_Click(tempSend, tempEvent);}")
Can I even call a sub like that?
Any help would be appreciated.
Thanks in advance!
Suzanne