close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Checkboxes not working

Thread began 10/05/2013 3:50 pm by mrs | Last modified 10/07/2013 11:36 am by Jason Byrnes | 568 views | 4 replies |

mrs

Checkboxes not working

I have run the Update Single Page wizard so many times, but just can't get the checkboxes to work. No matter what I do even if I don't touch them, they always enter a value of 1 into the DB. If I use the Data Assist wizard to create a new range of pages, then checkboxes work fine, but this isn't enabling me to work with the session that security assist creates to identify what user account I am affecting!

I have opened time and again the update record behaviour to bind each checkbox to its relevant DB field, I have set the dynamic value to the relevant DB field, I have set the type to Checkbox 0,1... I am at a loss.

This example code is from the Data Assist wizard which created a new update page which is working:

<input type="checkbox" name="UserVENUE" id="UserVENUE" value="1" <?php if (!(strcmp((isset($_GET["invalid"])?ValidatedField("userupdate","UserVENUE"):"".$row_SecurityAssisttblusers["UserVENUE"].""),"1"))) {echo "checked=\"checked\"";} ?>>

And this is from the Update Single Page wizard where I already have a form already in place:

<input name="UserVENUE" type="checkbox" id="UserVENUE" value="1" <?php if (!(strcmp($row_SecurityAssisttblusers['UserVENUE'],1))) {echo "checked=\"checked\"";} ?>>

There's a big difference in the code produced, but why? When I look at the dynamic values window from the property panel it has different code, so where can I learn what I need to enter there?

Even when I take the code of the Data Assist Update page and add and amend it to my page it still doesn't work! The only way it seems that I can get a checkbox to work is if I use the Data Assist created pages and pass the record ID to be updated through the URL rather than with the session ID!

Could you take a look at the attached file and let me know why the Update Single record wizard hasn't done what I expect and tell me where you think I have gone wrong?

Thanks

Sign in to reply to this post

mrs

OK, so I have just figured out how to do it with a sessionID on the Data Assist created page, and I have found out that there is a hidden field with the data assist created page which holds $_GET['ID'] for the passed URL. Changing that and the recordset to use $_SESSION['SecurityAssist_UserID'] has enabled me to forgo passing a url variable and thus overcome security issues.

What I want to know is why the page I attached in the first post which was created by Security Assist wizard doesn't have a hidden field with the ID, but the Data Assist Update page does? Why does the security assist update page that I attached work with all content on the correct record apart from the checkboxes?

I'm obviously missing something fundamental but probably very simple!

Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

In the page you attached the check box fields are UserEmailMrkt and UserEmail3rdPrty


in the update record behavior, you bound those fields to the recordset columns:
$row_SecurityAssisttblusers['UserEmailMrkt']
$row_SecurityAssisttblusers['UserEmail3rdPrty']

and not to the post variables from the form.



  What I want to know is why the page I attached in the first post which was created by Security Assist wizard doesn't have a hidden field with the ID, but the Data Assist Update page does?  


Security assist uses the Users ID variable which is stored in a session.

The update created by security assist is intended to happen on the user level using the users ID.

Data Assist Creates pages that can be used to update multiple records that pass an ID to determine which one. The update scenario created by security assist is completely different from the one created by data Assist.

Sign in to reply to this post

mrs

Aha, the difference between the two is obviously required then!

As for not binding to the form variables... I couldn't see that for love nor money. Thank you!

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...