close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

HTML Editor Dynamic Checkbox

Thread began 9/12/2011 5:16 am by Sly Verano | Last modified 9/12/2011 11:45 am by Jason Byrnes | 1867 views | 3 replies |

Sly Verano

HTML Editor Dynamic Checkbox

Hello Guys,

I need again your help,. I want to insert a record with specific destination and only that

specific users can view that records ...,.

-------------------------------------------------

for example: Lets say there is a 2 checkboxes: the professor checkbox and the student

checkbox.


now, If the professor checkbox is "checked" only the professors can view the that records

and same as with the student checkbox only the students can view that inserted records.

-------------------------------------------------------------------------

but if the 2 checkboxes are both "checked" ... students and professors are allowed to view

that records ...


Help me please ...

Thanks in Advanced ... :)

Sign in to reply to this post

Jason ByrnesWebAssist

set the checked value for the Prfesor checkbox and the student checkbox to 1

in your database, you will need 2 new columns, forProfs, forStudents

bind the forProfs column to the profesors checkbox and the forStudents column to the students checkbox.


you users table will also need a column to mark the userType as student or professor. Lets say we call this column "userType" and give it a value of 1 for students and 2 for professors


In the authenticate user server behavior on the login page, you will set the third step to store the userType column into a session variable when the user logs in.


then where you want to output the record use an if statement:


php:
<?php if(($_SESSION['userType'] == "1" && $row_recordsetName['forStudents'] == "1") ||($_SESSION['userType'] == "2" && $row_recordsetName['forProfs'] == "1"))

<?
php echo $row_recordsetName['pageContent']; ?>
<?php 
?>
Sign in to reply to this post

Sly Verano

Thanks for the response Jason,.

  set the checked value for the Prfesor checkbox and the student checkbox to 1

in your database, you will need 2 new columns, forProfs, forStudents

bind the forProfs column to the profesors checkbox and the forStudents column to the students checkbox.  



1.)what data type should I used in that two columns ? the integer or the boolean ?

2.)After I set the value of the checkbox to "1" for professor and student ... Is the name of

the checkboxes of the professor and student are the same ?

3.)do I have to include in the name of the checkbox this bracket " [] " after the name of

the checkboxes ?

4.)In the server behavior panel, the Insert Record(tbl_blah_blah), I will set the value of the

column prof and column students .. that get the value from the checkbox that has been

"checked ". Right ?

------------------------------------------

Thanks a lot Jason ... :)

Sign in to reply to this post

Jason ByrnesWebAssist

  1.)what data type should I used in that two columns ? the integer or the boolean ?  



use integer

  2.)After I set the value of the checkbox to "1" for professor and student ... Is the name of

the checkboxes of the professor and student are the same ?  



no, use unique names for the checkboxes

  3.)do I have to include in the name of the checkbox this bracket " [] " after the name of

the checkboxes ?  



No, you would only need to do that if the chackboxes are namedthe same, but they should have unique names

  4.)In the server behavior panel, the Insert Record(tbl_blah_blah), I will set the value of the

column prof and column students .. that get the value from the checkbox that has been

"checked ". Right ?  



yes, by binding the columns to the checkbox form element, it will insert the checked value "1" if the checkbox is checked, or leave it blank if the checkbox is not checked.

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