Questions about website background user permission design
Source: Internet
Author: User
Shows the design of website background user permissions. the left side is the background navigation, and the right side is the user's status (read-only, writable). The current requirement is to assign permissions to users, the question is, how can I pass the value of the check box along with the id & nbsp; of the preceding navigation bar? Just like this & nbsp; navigation website background user permission design issues
As shown in
Navigation in the background on the left and user status on the right (read-only and writable)
The requirement is to assign permissions to users.
When adding a user, how can I pass the value of the check box along with the preceding navigation id?
Like this, the navigation id, read, and edit correspond to the database ", 0, 1", ", 1 "...
If you select one of the check boxes, the corresponding database has only one navigation ID number + the value selected by the check box, such as () or )...
If none of them are selected, the database has only one navigation id.
How can we design inserts?
------ Solution --------------------
You need to process this in js first. Send a string (0100) to php and then to php for processing. package it into the desired format.
Take the four check boxes as an example.
Function mySubmit (){
Checkboxes = document. getElementsByName ("");
Var str = "";
For (I = 0; I If (checkboxes [I]. checked = true ){
Str + = "1 ";
} Else {
Str + = "0 ";
}
}
// For example, if 2 or 3 is selected, 0110 is used.
AddFrom. action + = "? Str = "+ str;
AddFrom. submit ();
}
Script
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.