aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes checkbox update/delete Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "checkbox update/delete" Watch "checkbox update/delete" New topic
Author

checkbox update/delete

kalle pettersson
Greenhorn

Joined: Jun 07, 2012
Posts: 7
if I have a checkbox and the value I want to make it a link



this is the code i am using (it is a recordset written in coldfusion)



I want the value from YesNo should be in the link if I have a checkbox and the value I want to make it a link

I have tried to make it work with javascript


but then he sees only the first recordset and not the others.
would need assistance to get to so it is possible to create an update / delete link for the form
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You can style the button to look like a link, CSS is good at that stuff!

or you can just have the link submit the form like the button does.

Eric
kalle pettersson
Greenhorn

Joined: Jun 07, 2012
Posts: 7
Eric Pascarello wrote:You can style the button to look like a link, CSS is good at that stuff!

or you can just have the link submit the form like the button does.

Eric


it does not help when there is a recordset. then there would be a button for each record. and how would it know which button I is right. Therefore it must link with checkbox. So it finds the correct recordset
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
So there is one link per checkbox and multiple checkboxes per form?
kalle pettersson
Greenhorn

Joined: Jun 07, 2012
Posts: 7
yes you can say it ..

that are many rows with one entry on each line but to avoid 2x buttons on each line, so you should be able to select only one row with checkbox and then be able to update or delete the record with an image / button or link. Then the loop through the lines and see what the checkbox is checked, and then use the value from that row.

this is the full code i am using.

Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Well ids are singular, you can only have one element with an id, hence why your code did not work.

I still do not understand why you do not have one form, you are basically reinventing the wheel.

What you would need to do is onclick, grab all of the checkboxes [getElementsByTagName] and loop through building up the values.

OR what I would do is use one form and submit it to the server.

Eric
kalle pettersson
Greenhorn

Joined: Jun 07, 2012
Posts: 7
but if I give it different id. how will it know which checkbox that I checked.

Do you have any examples of what you mean when I am currently stuck
am sure that I try to do it the hard way. therefore I hope to get back on track again and get through this function
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60077
    
  65

kalle pettersson wrote:but if I give it different id. how will it know which checkbox that I checked.

Each checkbox should have a unique value.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
kalle pettersson
Greenhorn

Joined: Jun 07, 2012
Posts: 7
#recTest.AlbID# is the id from the database, it is the primary key so it will be a unique ID. it is also the id that it finds the correct entry from the database.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60077
    
  65

The non-English part of your post has been removed. Please post only in English.

OK, so what's the question and/or problems at this point?
kalle pettersson
Greenhorn

Joined: Jun 07, 2012
Posts: 7
will try to explain what I mean

The first page lists everything from a recordset. if it lists as: movies

id 1 movie 1
id 2 movie 2

There are 10 movies so it will be 10 rows
to update as movie i needed an Update button or remove the film 1 on every rows,
what the link makes it take id and go to uppdate.cfm and brings up the record
if I'm going uppatera movie 1 becomes the link uppdate.cfm? id = 1, #recTest.AlbID# get the id value
but to avoid having say 10 st buttons for updating and 10 buttons for deleting
I want to use a CheckBox and 2 buttons, one for update and one to delete.

so I try to pick out the value of the checkbox that contains the ID value in the table and get it in the link as update, so the dream would be able to click a checkbox and get the value of the link

uppdate.cfm (update page) ?id= (Database Q) value checkbox (recordset id)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: checkbox update/delete
 
Similar Threads
Problem using divs.
form action
Client side validation not working
Need Help with binding click events to table rows
Using checkbox on Spring 2.5 MVC ?