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

can button show something other than value?

http://www.igearonline.com/subscribe/admin.asp

I created a table that is filled with database records. On each row of
the table I have a delete submit button to delete that record. I need
to associate one of the database fields with the delete button so I can
send that information back to the server side. Something like:

<input type="submit" name="delete" value= <% =rs.Fields(6) %> />

Then on server side i can do Request.Form("delete") and get the
database field to use for my query statement. But I still want the
button to say 'Delete'. Anyone have any suggestions?

Aug 31 '05 #1
9 2018
brian4cards wrote:

<input type="submit" name="delete" value= <% =rs.Fields(6) %> />

Then on server side i can do Request.Form("delete") and get the
database field to use for my query statement. But I still want the
button to say 'Delete'. Anyone have any suggestions?

Looks like you already found a solution using the ID attribute. Its
value should be quoted.
Or you could use <input type="hidden" ...> to identify the database field.

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Aug 31 '05 #2
Im not sure what you mean by using the ID attribute. Can i do <
input.........id= <% =rs.Fields(6) %> /> and then return the id value
to server side?

Aug 31 '05 #3
Jim Moe wrote:
brian4cards wrote:

<input type="submit" name="delete" value= <% =rs.Fields(6) %> />

Then on server side i can do Request.Form("delete") and get the
database field to use for my query statement. But I still want the
button to say 'Delete'. Anyone have any suggestions?

Looks like you already found a solution using the ID attribute. Its
value should be quoted.
Or you could use <input type="hidden" ...> to identify the database
field.


The problem is probably that you cannot enclose each table row in a <form>
of its own...

I usually do this sort of thing by using buttons like
<input type="submit" name="deleteNNN" value="Delete row">
where NNN is the database id that identifies the row.
In by server-side script I scan all name/value pairs in the form looking for
any name that matches the regular expression "delete\d+" and extract the id
from it.

--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
Aug 31 '05 #4
Benjamin Niemann wrote:
Jim Moe wrote:
brian4cards wrote:

<input type="submit" name="delete" value= <% =rs.Fields(6) %> />

Then on server side i can do Request.Form("delete") and get the
database field to use for my query statement. But I still want the
button to say 'Delete'. Anyone have any suggestions?

Looks like you already found a solution using the ID attribute. Its
value should be quoted.
Or you could use <input type="hidden" ...> to identify the database
field.


The problem is probably that you cannot enclose each table row in a <form>
of its own...


If the whole table is not a child of a form element (the other table cells
do not contain any input element), every delete button could be wrapped
into a form with any hidden inputs you may need.

--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
Aug 31 '05 #5
brian4cards wrote:
Im not sure what you mean by using the ID attribute. Can i do <
input.........id= <% =rs.Fields(6) %> /> and then return the id value
to server side?

My mistake. I confused this with another discussion.
Use <input type="hidden" ...>.

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Aug 31 '05 #6
brian4cards wrote:
http://www.igearonline.com/subscribe/admin.asp

I created a table that is filled with database records. On each row of
the table I have a delete submit button to delete that record. I need
to associate one of the database fields with the delete button so I can
send that information back to the server side. Something like:

<input type="submit" name="delete" value= <% =rs.Fields(6) %> />

Then on server side i can do Request.Form("delete") and get the
database field to use for my query statement. But I still want the
button to say 'Delete'. Anyone have any suggestions?


One way to handle it--which admittedly makes your page bigger--is to put
a separate form in each Edit and each Delete cell, rather than wrapping
the whole table in a single form.

<td ...>
<form ...>
<div>
<input type="hidden" name="personID" value="<%= rs.Fields(6) %>">
<input type="submit" name="delete" value="Delete">
</div>
</form>
</td>
Aug 31 '05 #7
Thank you all for your help, the multiple form technique worked!!

Aug 31 '05 #8
brian4cards wrote:
<input type="submit" name="delete" value= <% =rs.Fields(6) %> />

Then on server side i can do Request.Form("delete") and get the
database field to use for my query statement. But I still want the
button to say 'Delete'. Anyone have any suggestions?


Well, in theory you could use <button type="submitt" name="delete"
value="<% =rs.Fields(6) %>">Delete</button>, but unfortunately Internet
Explorer's lack of working support for <button> makes this impractical.

As a practical solution, you could give each button a different name, as
in <input type="submit" name="delete<% =rs.Fields(6) %>" valie="Delete">
and then check which name is present on the server side.
Aug 31 '05 #9
Adding those forms made each row larger (i guess that is what you were
talking about). Is there anyway to minimize the height of the rows?

Sep 2 '05 #10

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

Similar topics

1
by: Paul Gobée | last post by:
What is the parent element of a button (IE6 on Win, transitional mode)? Is it the BODY, the browser default stylesheet, or something else? Contra "body is parent-element": - Buttons with no...
6
by: Marek Mänd | last post by:
Can the <button><img></button> mutated via CSS so, that the inner image of <BUTTON> would entirely visually become the button itsself - I mean without the outer elements borders and so... ...
14
by: tshad | last post by:
I posted this on the asp.net group, also. I wasn't sure whether this was an asp.net problem or a javascript problem. I have a page that was originally created from a program I found on the net...
18
by: Colin McGuire | last post by:
Hi - this was posted last weekend and unfortunately not resolved. The solutions that were posted almost worked but after another 5 days of working on the code everynight, I am not further ahead....
7
by: MgGuigg | last post by:
Hello all, This is my first time posting a question to this forum, so here is hoping I am following protocol. I am scraping the rust off my old Basic programming skills, and have just recently...
5
by: Wonder | last post by:
How can I create or use the msgobx to show a message without a default button. The user has explicity to click on the button, so the msgbox closes it. Thanks,
3
by: Kannan | last post by:
Hi, I am trying to created Outloook Add-in Com in outlook using C#. I have seen this URL for developing this sample http://support.microsoft.com/?kbid=302901 When I executed this program it...
6
by: sgottenyc | last post by:
Hello, If you could assist me with the following situation, I would be very grateful. I have a table of data retrieved from database displayed on screen. To each row of data, I have added...
5
by: gregarican | last post by:
There is a C# CTI app I'm working on using Visual Studio 2005 at revision level 8.0.50727-7600. I need a couple of Windows Form Button controls to emulate line buttons on a telephone. So I went to...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.