How to update using checked boxes

Hi everyone, when I go to update my checked boxes I’m having issues wehre either the boxes that should be checked aren’t, or that the value in the table won’t update after submitting the form. Even though when I click update again the change has been made, my read table doesn’t reflect it.

Any help towards this matter would be greatly appreciated. Thank you.

Have you bound your data to your check box?

Screenshot 2023-11-09 at 1.25.03 PM

Screenshot 2023-11-09 at 1.25.58 PM

come to find out none of my updates have linked properly. It looks as though they are referencing the first input in that table instead of referencing the specific input I’ve clicked upon.

image


(this is my read or get micronote)

Where is your update form? Is it on a separate page in in a data detail region on the same page?

Can you paste the code that links to your update form?

It’s on my layout page so I can easily reference it. You mean my server connect form correct? I have a Create API, a Get API (holds all of my reads as queries), and a Delete API. Let me get the code

image

Your dmx-bind:values are all wrong. They should not have the [0] in it.

Is your form inside a data detail region? Can you post the code for your edit link? Your form should be inside a data detail region.

1 Like


image

I hope that this helps and is what you were looking for.

I followed the instructions in that article, and I can’t get it to display my information still:

WHOOPS! my mistake, I forgot to include the select data detail feature, works like a charm. Thank you.

2 Likes

Glad it’s working for you. Good luck with your project!

One more thing, it works for displaying the text I need and it’s updating that properly, but it still isn’t returning if the box is checked or not when I reference the data detail.

Can you post your code for your checkbox? You are probably missing this …

My response is nothing to do with check boxes and more to do with the amount of errors showing in your page. That’s a lot of errors Parker! Simply an observation on my part…

Ah, maybe set a value on dynamic attributes ‘Checked’ … you probably don’t need the dmx-bind:value any longer after adding the checked attribute. Been awhile since I used check boxes.

And as Cheese pointed out, you have a ton of code errors on the page. Most likely duplicate IDs.

what do these duplicate ID’s mean and how will it affect me going forward

It’s invalid code. IDs must be unique. You will want to fix them. Clicking on the red X at the bottom left corner of your code view will tell you exactly what the errors are.

Screenshot 2023-11-09 at 3.30.08 PM

1 Like

so because all my inserts are inp_myid it’s flagging that. I’m confused as to how this is invalid code but it still operates on the desktop. What about it makes it makes it an error (sorry if a dumb question, I’m brand new to website development)

In HTML, the ID attribute is used to uniquely identify an element within a document. The main reason IDs need to be unique is to ensure that the document’s structure is well-defined and that different parts of the document can be easily distinguished and manipulated. When each element has a unique identifier, it becomes much easier for developers to reference specific elements using scripts, stylesheets, or other programming languages.

Here are a few reasons why IDs need to be unique in HTML:

  1. Scripting and styling: Unique IDs allow developers to easily manipulate specific elements using JavaScript or CSS. By selecting elements based on their unique IDs, developers can apply specific styles or execute particular functions for a specific element.

  2. Document structure: Unique IDs help in creating a clear and unambiguous document structure. When IDs are unique, it becomes easier for developers and web browsers to understand the relationships between different elements within the document.

  3. Accessibility: Unique IDs aid in creating accessible web content. They enable assistive technologies, such as screen readers, to navigate the document more efficiently, improving the overall accessibility and user experience.

  4. Linking and navigation: Unique IDs can be used as anchors within a document, allowing users to navigate to specific sections of a page quickly. When IDs are unique, it becomes straightforward to link to specific parts of a document using anchor tags.

Failure to maintain unique IDs can lead to unexpected behavior and may cause issues in rendering the web page correctly. For instance, if multiple elements have the same ID, it can lead to conflicts when trying to manipulate those elements using scripts or stylesheets. Therefore, it is a best practice to ensure that IDs are unique within the HTML document.

2 Likes