473,578 Members | 2,739 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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("d elete") 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 2023
brian4cards wrote:

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

Then on server side i can do Request.Form("d elete") 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.........i d= <% =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("d elete") 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("d elete") 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.........i d= <% =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("d elete") 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("d elete") 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
2584
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 style specified have a different font-size than the body's font-size. - If I change the body's font-size, a button with no style specified remains at...
6
6887
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... I tried removing paddings and borders and margins but this wouldnt seem to help. in MSIE, Mozilla and Opera - there still some pieces of the
14
5444
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 that works well as an html page. It brings up a modal popup window that I have been trying to work out for days now and this was the closest I...
18
2942
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. If you do have any ideas I would really like to hear them. Thanks Colin - 0 - 0 - 0 - I want a glorified popup/context menu on a button that...
7
2569
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 upgraded to VB.NET, and I have a lot of catching up to do. That being said, I have come a long way in a short while, however, I am stumped at the...
5
5418
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
1988
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 created new custom button called "My Custom Button" in the Outlook menu bar. But when I tried to create one more button called "Forward Mail" (code...
6
2716
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 action buttons, such as "Edit", "Add", and "Comment". Since I do not know how many rows of data will be retrieved - and therefore how many buttons I...
5
2811
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 create a class file for the user control to subclass this out. Something basic for a start, just initializing things. When I drag this custom...
0
8291
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7874
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...
0
8150
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5664
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...
0
5343
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3786
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...
1
2293
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
1391
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1114
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...

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.