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

updating with hidden fields

Thread began 3/24/2014 11:23 am by Jamie | Last modified 3/24/2014 4:36 pm by Jason Byrnes | 194 views | 3 replies |

Jamie

updating with hidden fields

Hey Jason

Am using security assist to show specific content in an update page if the visitor has the necessary auth credentials. If they dont, the 'Live' and 'PageName' are invisible so have added hidden fields to make sure the database isnt updated with empty fields but it isnt working and not sure what I have done wrong. Basically, if youre logged in as Super Admin and you update either the 'Live' or 'PageName' fields the update does not take effect and just remains what it was. If youre logged in as Admin it does what it should (ie hide the Live and PageName inputs and not update the db on update)

<?php if(WA_Auth_RulePasses("Super Administrator")){ ?>
<div class="lineGroup">
<div class="errorGroup"> <span>
<label class="sublabel" for="Live">Live?
<input type="checkbox" name="Live" id="Live" value="1" class="formCheckboxField_Standard" <?php if (!(strcmp($row_WADApage_contents['Live'],1))) {echo "checked=\"checked\"";} ?> tabindex="1">
</label>
<span style="font-size:12px;">(if checkbox is 'ticked', the page is live)</span></span> </div>
</div>
<div class="lineGroup">
<label for="PageName" class="sublabel" > Page:</label>
<div class="errorGroup"> <span>
<input id="PageName" name="PageName" type="text" value="<?php echo((isset($_GET["invalid"])?ValidatedField("pagecontentsupdate","PageName"):"".$row_WADApage_contents["PageName"]."")); ?>" class="formTextfield_Medium" tabindex="2" style="width:650px; height:35px; font-size:16px;">
</span> </div>
</div>
<?php } // End Show Region ?>
<input name="Live" type="hidden" value="<?php echo $row_WADApage_contents['Live']; ?>" />
<input name="PageName" type="hidden" value="<?php echo $row_WADApage_contents['PageName']; ?>" />
Sign in to reply to this post

Jason ByrnesWebAssist

reverse the code, move the hidden fields so they are before the security assist show if.

basically, the way you have it set up, if the are super admin, it is adding the checkboxes, then adding the hidden fields after them because there is no condition to hide them

this means the hidden fields, being last, are over riding the checkboxes for the super admin.

either move the hidden fields to be before the checkboxes so that the checkboxes will over ride the hidden fields, or add a condition to hide them for the super admin.

Sign in to reply to this post

Jamie

thanks Jason....makes complete sense as always!

Jamie

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...