473,385 Members | 1,838 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,385 software developers and data experts.

Issue with Multiple Submit Buttons

Hi,

I have a web form where a user can enter child parts for a given parent part.

On the top of the page is a text box and a sumbit button labeled "Retrieve
Child Parts". When type some part number and press enter all child parts for
the given parts are retrived from a db table and bound to a Datagrid. The
data grid has 3 columns, child part number, child part description and delete
column. the delete column is a templated column where there is a Imagebutton.
when the user clicks on the image the child part is deleted. Below the grid
is another textbox and a submit button labled "Add Child Part". The
requirement is that when the user wants to enter a new Child Part, all he has
to do is type the part number and hit enter. however in my case if the user
hits enter in the add new child part text box, instead of trigger the add new
child part button "on click", it triggers the "on click" of the last delete
image button in the grid. How do I control it in such a way as to have the
sumbit button and not the image button is clicked.
--
Regards,
Matt.
Nov 19 '05 #1
1 1450
You can set focus on particular buttons in an ASP.NET application, but you
will have to set it on a return trip, if you wish to use the server app to do
it.

Page.RegisterHiddenField( "__EVENTTARGET", "ButtonNameHere" );

If all of your actions are clients side until a "save" button is clicked,
you will have to do this with JavaScript. You can build a custom wrapper of
the DataGrid to have this funcationlity automatically applied (ie, write the
JavaScript once and have it default behavior of your custom DataGrid).

---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"Matt" wrote:
Hi,

I have a web form where a user can enter child parts for a given parent part.

On the top of the page is a text box and a sumbit button labeled "Retrieve
Child Parts". When type some part number and press enter all child parts for
the given parts are retrived from a db table and bound to a Datagrid. The
data grid has 3 columns, child part number, child part description and delete
column. the delete column is a templated column where there is a Imagebutton.
when the user clicks on the image the child part is deleted. Below the grid
is another textbox and a submit button labled "Add Child Part". The
requirement is that when the user wants to enter a new Child Part, all he has
to do is type the part number and hit enter. however in my case if the user
hits enter in the add new child part text box, instead of trigger the add new
child part button "on click", it triggers the "on click" of the last delete
image button in the grid. How do I control it in such a way as to have the
sumbit button and not the image button is clicked.
--
Regards,
Matt.

Nov 19 '05 #2

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

Similar topics

2
by: Matt | last post by:
The ASP page has multiple buttons, and when the user clicks different buttons, it will submit the form data to different URLs. My first approach was to use BUTTON type, and triggers javascript...
3
by: D. Shane Fowlkes | last post by:
Sorry for the length of this post. I have created a rather complex form which has a header/line item (parent and child records) structure. It's for an intranet. A screenshot can be seen here: ...
5
by: Lau Lei Cheong | last post by:
Hello, Let's say that I have multiple submit buttons on a form (imagebuttons actually, but documentations say that <input type=image> which a called image buttons should behave like submit...
3
by: Suresh | last post by:
Hi, I have a button and on click i am calling a script function to invoke a dialog argument. btnPopup.attributes.add("OnClick","showpopup();return false;") Now the problem is that when i...
1
by: Bill_W_Stephens | last post by:
I have a complicated page with several submit buttons. I don't want to create multiple forms because much of the input is shared and the code is getting very ugly. However I would like to determine...
5
by: Alex Maghen | last post by:
In ASPX 2.0 with MasterPages and all that, my entire page only has one actual <FORM>. But there are several different sections of the page that provide what are functionally separate forms with...
5
by: mayur_hirpara | last post by:
Hi, I have been developing web applications for a while now. However, as I was thinking through the architecture I really don't understand the "How server can identify between which buttons has...
4
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all I have the following code: I am trying to use the value of the image button to evaluate what plan the user has chosen, i.e. it request("submit1")="Basic", then the user chose basic plan...
9
by: mosscliffe | last post by:
I am struggling to find a python example of the scenario - I have. I have a python script, which generates a page with a search button (actually an input field). The data from the above...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.