Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2412
  • Last Modified:

Checkbox update record

Is it possible to have a master page with a checkbox, that can update a record if selected?
0
vonfranzken
Asked:
vonfranzken
  • 3
  • 3
1 Solution
 
Jason C. LevineNo oneCommented:
Hi vonfranzken,

Yes, it is possible.

Could you post a little more detail about what you are trying to do and which server model you're doing it with?
0
 
vonfranzkenAuthor Commented:
Sure in fact here is a copy of the error I get when I try to it says.

Error Type:
ADODB.Field (0x800A0BCD)
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/musicforall/newsroom/news_master.asp, line 267


Line 267 is this:
<input type="hidden" name="MM_recordId" value="<%= Recordset1.Fields.Item("id").Value %>">

This is put in when I apply the update record to the checkbox via the master list.

0
 
vonfranzkenAuthor Commented:
Im sorry asp
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Jason C. LevineNo oneCommented:
It sounds like the Primary key value is not set in the form.  DW's update behavior requires the unique ID number of the record to be updated to be present in the form.  How are you setting that?
0
 
vonfranzkenAuthor Commented:
Well Im not Im just listing from lets say recordset1 a master list of records which resides in form1 with an added checkbox
I then applied an update behavior to the checkbox, and used the same recordset which lists them.
I then have a javascript submit form behavior applied to the checbox to submit the update in the event it is checked or un-checked.

I think its having a hard time distinguishing which record to update via the master list.

Steve
0
 
Jason C. LevineNo oneCommented:
Steve,

Right.  You are misusing the update record behavior.  The built-in behavior requires one primary key per form in order to work correctly.

If you output a bunch of records in a repeat region and stick that region inside of a form, you can't use the update record behavior.

What you can do is put the form tags INSIDE the repeat region (in a table cell, say) and your method should work.  It may require you to do a little hand coding, though.

The other way to do this with only one form is to have all values submit as an array and then hand code the update behavior so that it steps through the array and runs the sql update for each record in the array.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now