A
A
Artem2020-05-18 12:59:58
PHP
Artem, 2020-05-18 12:59:58

How to hide or block a form?

There are 3 products. These products have their own ratings. Let's say the user clicks on the stars of the 3rd rating. Then there is a check and for this user the 3rd rating form is closed or more precisely overlapped in some way (by creating a block on top of the form). Here's the solution I'm trying to find. I send data using ajax .

$ra1 = $row['rating']; 
    $checked = intval($ra1); 
    $count = 5; 
    $inputs = '';
    for($i = 1; $i <= $count; $i++) { 
    $checked_attr = $i == $checked ? ' checked' : '';
    $inputs .= '<input  class="rating-input" id="mod' . $i . '' . $row["products_id"] . '" star-attr="' . $row["products_id"] . '" name="radio-rating" type="radio" value="' . $i . '"' . $checked_attr . '>';
    $inputs .= '<label class="rating-star" for="mod' . $i . '' . $row["products_id"] . '" ></label>';
    };

    // вывод
    echo '
    <div  class="order_right">  
     <div  class="wrap_stars">
      <form class="form-rating" method="POST"> // заблокировать форму на которую нажали
      <fieldset class="fieldset">
      <legend></legend>
      <div class="rating-group">

       ' .$inputs . '
      
       </div>
      </fieldset>
        <div class="count_block">
        <!-- Статистика -->
        <ul class="count" >' . $row["rating"] . '</ul>
        </div>
       </form>
      </div>
    </div>

5ec25c8c26b50277618248.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question