473,216 Members | 1,584 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,216 software developers and data experts.

Choosing whitch button will act as submit button

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
the user push the [enter] button in the search field. Well, this doesn't
happen. The first (left) button on the usercontol top-menu fires, whitch
brings the user to completely different page (whitch is the intention when
the user actually clicks this button)

I have tried to add another form tag for this, but no thank you, only one
server side form tag, please!

I have tried various ugly workarounds, like passing session variables so
that the button in the top-menu actually clicks back on the other button. No
luck.

Anyone with an idea on how to pick whitch button that will act as submit
button, when usercontrols with buttons are included?

Thanks.
Regards
Bjorn
Dec 10 '06 #1
7 2037
Yes, This will prevent any enter key submiting. However, you can extend this
to allow the one you want to submit.

http://www.trainingon.net/Articles/Art147/Art147.html

--

Best Regards - OHM

http://TrainingOn.net
--------------------------------------------------
"Bjorn Sagbakken" <bj*****@online.nowrote in message
news:q7********************@telenor.com...
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
the user push the [enter] button in the search field. Well, this doesn't
happen. The first (left) button on the usercontol top-menu fires, whitch
brings the user to completely different page (whitch is the intention when
the user actually clicks this button)

I have tried to add another form tag for this, but no thank you, only one
server side form tag, please!

I have tried various ugly workarounds, like passing session variables so
that the button in the top-menu actually clicks back on the other button.
No luck.

Anyone with an idea on how to pick whitch button that will act as submit
button, when usercontrols with buttons are included?

Thanks.
Regards
Bjorn

Dec 10 '06 #2
Yes, I have been thinking of trapping the enter key (ascii 13), but this has
to be done in the asp:textbox (I think), and I am not sure how to do this.
Maybe in a page event, but which?
I using VB, so I would be grateful for any code example in VB.

Bjorn

"Microsoft" <news.microsoft.comwrote in message
news:uY*************@TK2MSFTNGP06.phx.gbl...
Yes, This will prevent any enter key submiting. However, you can extend
this to allow the one you want to submit.

http://www.trainingon.net/Articles/Art147/Art147.html

--

Best Regards - OHM

http://TrainingOn.net
--------------------------------------------------
"Bjorn Sagbakken" <bj*****@online.nowrote in message
news:q7********************@telenor.com...
>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 the user push the [enter] button in the search field. Well, this
doesn't happen. The first (left) button on the usercontol top-menu fires,
whitch brings the user to completely different page (whitch is the
intention when the user actually clicks this button)

I have tried to add another form tag for this, but no thank you, only one
server side form tag, please!

I have tried various ugly workarounds, like passing session variables so
that the button in the top-menu actually clicks back on the other button.
No luck.

Anyone with an idea on how to pick whitch button that will act as submit
button, when usercontrols with buttons are included?

Thanks.
Regards
Bjorn


Dec 10 '06 #3
OHM
This needs to be done on the client side using script langauge. You need to
trap the onkeydown event of the body tag.

--

Best Regards - OHM

http://TrainingOn.net
--------------------------------------------------
"Bjorn Sagbakken" <bj*****@online.nowrote in message
news:Co********************@telenor.com...
Yes, I have been thinking of trapping the enter key (ascii 13), but this
has to be done in the asp:textbox (I think), and I am not sure how to do
this. Maybe in a page event, but which?
I using VB, so I would be grateful for any code example in VB.

Bjorn

"Microsoft" <news.microsoft.comwrote in message
news:uY*************@TK2MSFTNGP06.phx.gbl...
>Yes, This will prevent any enter key submiting. However, you can extend
this to allow the one you want to submit.

http://www.trainingon.net/Articles/Art147/Art147.html

--

Best Regards - OHM

http://TrainingOn.net
--------------------------------------------------
"Bjorn Sagbakken" <bj*****@online.nowrote in message
news:q7********************@telenor.com...
>>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 the user push the [enter] button in the search field. Well, this
doesn't happen. The first (left) button on the usercontol top-menu
fires, whitch brings the user to completely different page (whitch is
the intention when the user actually clicks this button)

I have tried to add another form tag for this, but no thank you, only
one server side form tag, please!

I have tried various ugly workarounds, like passing session variables so
that the button in the top-menu actually clicks back on the other
button. No luck.

Anyone with an idea on how to pick whitch button that will act as submit
button, when usercontrols with buttons are included?

Thanks.
Regards
Bjorn



Dec 10 '06 #4
All right, I give in. Although I think it is kind of stupid that the
server-code cannot decide whitch button should be the submit button. I even
tried to tingle with the tabindex. I mean, on the form_load it should be
easy enough to state this.

But since I am fairly new to client scripting I couldn't make that work
either. I tried something like this:
<script language =vbscript>
Sub Search

if window.event.keyCode=13 then

event.returnvalue=False

event.cancel=True

endif

end sub

</script>

I only get a page error.

Regards
Bjorn

"OHM" <news.microsoft.comwrote in message
news:u7****************@TK2MSFTNGP05.phx.gbl...
This needs to be done on the client side using script langauge. You need
to trap the onkeydown event of the body tag.

--

Best Regards - OHM

http://TrainingOn.net
--------------------------------------------------
"Bjorn Sagbakken" <bj*****@online.nowrote in message
news:Co********************@telenor.com...
>Yes, I have been thinking of trapping the enter key (ascii 13), but this
has to be done in the asp:textbox (I think), and I am not sure how to do
this. Maybe in a page event, but which?
I using VB, so I would be grateful for any code example in VB.

Bjorn

"Microsoft" <news.microsoft.comwrote in message
news:uY*************@TK2MSFTNGP06.phx.gbl...
>>Yes, This will prevent any enter key submiting. However, you can extend
this to allow the one you want to submit.

http://www.trainingon.net/Articles/Art147/Art147.html

--

Best Regards - OHM

http://TrainingOn.net
--------------------------------------------------
"Bjorn Sagbakken" <bj*****@online.nowrote in message
news:q7********************@telenor.com...
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 the user push the [enter] button in the search field. Well,
this doesn't happen. The first (left) button on the usercontol top-menu
fires, whitch brings the user to completely different page (whitch is
the intention when the user actually clicks this button)

I have tried to add another form tag for this, but no thank you, only
one server side form tag, please!

I have tried various ugly workarounds, like passing session variables
so that the button in the top-menu actually clicks back on the other
button. No luck.

Anyone with an idea on how to pick whitch button that will act as
submit button, when usercontrols with buttons are included?

Thanks.
Regards
Bjorn



Dec 10 '06 #5
Use the script exactly as supplied for the browser. You don't want to use
VBScript on the client side, JavaScript is the universal way. Server code
cannot decide which button should be the submit since this is controlled by
the browser itself and the browser has it's own way of determining which
should be the submit, usually the first button that can postback that exists
within the forms control hierarchy.
--

Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"Bjorn Sagbakken" <bj*****@online.nowrote in message
news:Rt********************@telenor.com...
All right, I give in. Although I think it is kind of stupid that the
server-code cannot decide whitch button should be the submit button. I
even tried to tingle with the tabindex. I mean, on the form_load it should
be easy enough to state this.

But since I am fairly new to client scripting I couldn't make that work
either. I tried something like this:
<script language =vbscript>
Sub Search

if window.event.keyCode=13 then

event.returnvalue=False

event.cancel=True

endif

end sub

</script>

I only get a page error.

Regards
Bjorn

"OHM" <news.microsoft.comwrote in message
news:u7****************@TK2MSFTNGP05.phx.gbl...
>This needs to be done on the client side using script langauge. You need
to trap the onkeydown event of the body tag.

--

Best Regards - OHM

http://TrainingOn.net
--------------------------------------------------
"Bjorn Sagbakken" <bj*****@online.nowrote in message
news:Co********************@telenor.com...
>>Yes, I have been thinking of trapping the enter key (ascii 13), but this
has to be done in the asp:textbox (I think), and I am not sure how to do
this. Maybe in a page event, but which?
I using VB, so I would be grateful for any code example in VB.

Bjorn

"Microsoft" <news.microsoft.comwrote in message
news:uY*************@TK2MSFTNGP06.phx.gbl...
Yes, This will prevent any enter key submiting. However, you can extend
this to allow the one you want to submit.

http://www.trainingon.net/Articles/Art147/Art147.html

--

Best Regards - OHM

http://TrainingOn.net
--------------------------------------------------
"Bjorn Sagbakken" <bj*****@online.nowrote in message
news:q7********************@telenor.com...
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 the user push the [enter] button in the search field. Well,
this doesn't happen. The first (left) button on the usercontol
top-menu fires, whitch brings the user to completely different page
(whitch is the intention when the user actually clicks this button)
>
I have tried to add another form tag for this, but no thank you, only
one server side form tag, please!
>
I have tried various ugly workarounds, like passing session variables
so that the button in the top-menu actually clicks back on the other
button. No luck.
>
Anyone with an idea on how to pick whitch button that will act as
submit button, when usercontrols with buttons are included?
>
Thanks.
>
>
Regards
Bjorn
>




Dec 10 '06 #6
Thanks, I think I'm beginning to understand the concept now. The script
almost works, disabling the [ENTER] keypress, but I haven't yet been
successful in executing the desired button_click action instead. This
application is for my company's Intranet, so VBScript will do in the first
place, everyone is stuck with Microsoft, except for Lotus Notes for mail.
But I will start learning the basics of JavaScript for puposes like this.

Bjorn

"Mark Fitzpatrick" <ma******@fitzme.comwrote in message
news:eQ**************@TK2MSFTNGP04.phx.gbl...
Use the script exactly as supplied for the browser. You don't want to use
VBScript on the client side, JavaScript is the universal way. Server code
cannot decide which button should be the submit since this is controlled
by the browser itself and the browser has it's own way of determining
which should be the submit, usually the first button that can postback
that exists within the forms control hierarchy.
--

Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"Bjorn Sagbakken" <bj*****@online.nowrote in message
news:Rt********************@telenor.com...
>All right, I give in. Although I think it is kind of stupid that the
server-code cannot decide whitch button should be the submit button. I
even tried to tingle with the tabindex. I mean, on the form_load it
should be easy enough to state this.

But since I am fairly new to client scripting I couldn't make that work
either. I tried something like this:
<script language =vbscript>
Sub Search

if window.event.keyCode=13 then

event.returnvalue=False

event.cancel=True

endif

end sub

</script>

I only get a page error.

Regards
Bjorn

"OHM" <news.microsoft.comwrote in message
news:u7****************@TK2MSFTNGP05.phx.gbl...
>>This needs to be done on the client side using script langauge. You need
to trap the onkeydown event of the body tag.

--

Best Regards - OHM

http://TrainingOn.net
--------------------------------------------------
"Bjorn Sagbakken" <bj*****@online.nowrote in message
news:Co********************@telenor.com...
Yes, I have been thinking of trapping the enter key (ascii 13), but
this has to be done in the asp:textbox (I think), and I am not sure how
to do this. Maybe in a page event, but which?
I using VB, so I would be grateful for any code example in VB.

Bjorn

"Microsoft" <news.microsoft.comwrote in message
news:uY*************@TK2MSFTNGP06.phx.gbl...
Yes, This will prevent any enter key submiting. However, you can
extend this to allow the one you want to submit.
>
http://www.trainingon.net/Articles/Art147/Art147.html
>
>
>
--
>
Best Regards - OHM
>
http://TrainingOn.net
--------------------------------------------------
>
>
"Bjorn Sagbakken" <bj*****@online.nowrote in message
news:q7********************@telenor.com...
>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 the user push the [enter] button in the search field. Well,
>this doesn't happen. The first (left) button on the usercontol
>top-menu fires, whitch brings the user to completely different page
>(whitch is the intention when the user actually clicks this button)
>>
>I have tried to add another form tag for this, but no thank you, only
>one server side form tag, please!
>>
>I have tried various ugly workarounds, like passing session variables
>so that the button in the top-menu actually clicks back on the other
>button. No luck.
>>
>Anyone with an idea on how to pick whitch button that will act as
>submit button, when usercontrols with buttons are included?
>>
>Thanks.
>>
>>
>Regards
>Bjorn
>>
>
>




Dec 11 '06 #7
Yes, now everthing works like a dream. Just a little client scripting was
all it took.
Thanks everyone.

Bjorn

"Bjorn Sagbakken" <bj*****@online.nowrote in message
news:Na********************@telenor.com...
Thanks, I think I'm beginning to understand the concept now. The script
almost works, disabling the [ENTER] keypress, but I haven't yet been
successful in executing the desired button_click action instead. This
application is for my company's Intranet, so VBScript will do in the first
place, everyone is stuck with Microsoft, except for Lotus Notes for mail.
But I will start learning the basics of JavaScript for puposes like this.

Bjorn

"Mark Fitzpatrick" <ma******@fitzme.comwrote in message
news:eQ**************@TK2MSFTNGP04.phx.gbl...
>Use the script exactly as supplied for the browser. You don't want to use
VBScript on the client side, JavaScript is the universal way. Server code
cannot decide which button should be the submit since this is controlled
by the browser itself and the browser has it's own way of determining
which should be the submit, usually the first button that can postback
that exists within the forms control hierarchy.
--

Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"Bjorn Sagbakken" <bj*****@online.nowrote in message
news:Rt********************@telenor.com...
>>All right, I give in. Although I think it is kind of stupid that the
server-code cannot decide whitch button should be the submit button. I
even tried to tingle with the tabindex. I mean, on the form_load it
should be easy enough to state this.

But since I am fairly new to client scripting I couldn't make that work
either. I tried something like this:
<script language =vbscript>
Sub Search

if window.event.keyCode=13 then

event.returnvalue=False

event.cancel=True

endif

end sub

</script>

I only get a page error.

Regards
Bjorn

"OHM" <news.microsoft.comwrote in message
news:u7****************@TK2MSFTNGP05.phx.gbl.. .
This needs to be done on the client side using script langauge. You
need to trap the onkeydown event of the body tag.

--

Best Regards - OHM

http://TrainingOn.net
--------------------------------------------------
"Bjorn Sagbakken" <bj*****@online.nowrote in message
news:Co********************@telenor.com...
Yes, I have been thinking of trapping the enter key (ascii 13), but
this has to be done in the asp:textbox (I think), and I am not sure
how to do this. Maybe in a page event, but which?
I using VB, so I would be grateful for any code example in VB.
>
Bjorn
>
"Microsoft" <news.microsoft.comwrote in message
news:uY*************@TK2MSFTNGP06.phx.gbl...
>Yes, This will prevent any enter key submiting. However, you can
>extend this to allow the one you want to submit.
>>
>http://www.trainingon.net/Articles/Art147/Art147.html
>>
>>
>>
>--
>>
>Best Regards - OHM
>>
>http://TrainingOn.net
>--------------------------------------------------
>>
>>
>"Bjorn Sagbakken" <bj*****@online.nowrote in message
>news:q7********************@telenor.com...
>>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 the user push the [enter] button in the search
>>field. Well, this doesn't happen. The first (left) button on the
>>usercontol top-menu fires, whitch brings the user to completely
>>different page (whitch is the intention when the user actually
>>clicks this button)
>>>
>>I have tried to add another form tag for this, but no thank you,
>>only one server side form tag, please!
>>>
>>I have tried various ugly workarounds, like passing session
>>variables so that the button in the top-menu actually clicks back on
>>the other button. No luck.
>>>
>>Anyone with an idea on how to pick whitch button that will act as
>>submit button, when usercontrols with buttons are included?
>>>
>>Thanks.
>>>
>>>
>>Regards
>>Bjorn
>>>
>>
>>
>
>




Dec 12 '06 #8

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

Similar topics

3
by: Matt | last post by:
I want to understand the difference between submit button and regular button: <input type="submit"> and <input type="button">. My understanding is that submit button will send the entire HTML form...
5
by: Bunny | last post by:
Is there a way to automatically load a page, after the user selects a menu item from a form?
4
by: Dmitry Korolyov [MVP] | last post by:
When we use btnSubmit.Attributes = "javascript: this.disabled=true;" to make the button disabled and prevent users from clicking it again while form data still posting, there is no longer...
3
by: Jeff | last post by:
I have a payment form with a submit button. A large percentage of users double-click the submit button thus submitting their payment information twice. I would like to use javascript to disable...
11
by: Neo Geshel | last post by:
Greetings. Hopefully someone will be able to untie this Gordian Knot I have found myself bound up in. I am trying to add a submit button dynamically to a PlaceHolder. This button will help...
6
by: Guch | last post by:
I'll swictch from Matlab to C++. So I want to find a matrix library of C++, Whitch can process images conveniently as Matlab does. I've googled, and found that Blitz++ and MTL are popular and...
2
by: bay_dar | last post by:
Hi, I have an internal ASP.NET application that I'm are using to send e-mails out based on a single milepost or milepost range entered. I'm trying to do two things when a user clicks on the...
3
by: remya1000 | last post by:
i'm using ASP with MSAccess as database. i have two buttons and two textbox in my page. when i press my first button (First month) i need to display the current month in one textbox and last one...
5
by: plumba | last post by:
Ok, another query.... I have a checkbox at the bottom of my form which when checked unhides a <div> block which displays the submit button. The problem I have is when the clear form button is...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

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.