"star rating feedback form "
Bootstrap 4.1.1 Snippet by alexdev

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<script type="text/javascript" src="magicRating.js"></script>
<link href="https://fonts.googleapis.com/css?family=Montserrat:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i&subset=latin-ext,vietnamese" rel="stylesheet">
</head>
<body>
<div class="container">
<h2>Modal Example</h2>
<!-- Trigger the modal with a button -->
<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Open Modal</button>
<!-- Modal -->
<div class="modal fade " id="myModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content page1-->
<div style="" class="modal-content" id="main_popup">
<div class="modal-body ">
<div class="col-lg-12">
<button type="button" class="close close_model" data-dismiss="modal"><span class="glyphicon glyphicon-remove-circle
"></span>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
body {
font-family: 'Montserrat', sans-serif;
font-weight: 600;
}
.give_feedback .btn-default {
color: #333;
background: #ff7429;
border-color: #ccc;
border-radius: 0px;
padding: 12px 60px;
font-size: 20px;
margin: 30px;
color: #fff;
font-weight: inherit;
text-align: center;
}
.progress-bar-info {
background-color: #ff7429 !important;
}
.ok {
background-color: #ff7429 !important;
padding: 9px 28px !important;
border-radius: 0px !important;
color: #fff;
}
.give_feedback .btn-default {
color: #333;
background: #ff7429;
border-color: #ccc;
border-radius: 0px;
padding: 12px 60px;
font-size: 20px;
margin: 30px;
color: #fff;
font-weight: inherit;
text-align: center;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Init function
$.fn.magicRatingInit = function(config) {
// Init each widget return by the selector
for (widget of $(this)) {
var magicRatingWidget = $(widget);
//// Get datas ////
// Icon +
if (magicRatingWidget.data("iconGood") == null) {
magicRatingWidget.data("iconGood", config.iconGood != null ? config.iconGood : "fa-star");
};
// Icon -
if (magicRatingWidget.data("iconBad") == null) {
magicRatingWidget.data("iconBad", config.iconBad != null ? config.iconBad : "fa-star-o");
};
// Max mark
if (magicRatingWidget.data("maxMark") == null) {
magicRatingWidget.data("maxMark", config.maxMark != null ? config.maxMark : 5);
}
/*
console.log(magicRatingWidget.data("iconGood"));
console.log(magicRatingWidget.data("iconBad"));
*/
// Clear the widget
magicRatingWidget.html("");
// Init icons
for (i = 1; i <= magicRatingWidget.data("maxMark"); i++) {
if (i <= magicRatingWidget.data("currentRating")) {
magicRatingWidget.append('<i class=" ' + magicRatingWidget.data("iconGood") + ' magic-rating-icon" aria-hidden="true" data-default=true data-rating=' + i + '></i>');
} else {
magicRatingWidget.append('<i class=" ' + magicRatingWidget.data("iconBad") + ' magic-rating-icon" aria-hidden="true" data-default=false data-rating=' + i + '></i>');
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: