L
L
LiveHuman2015-11-29 22:05:33
JavaScript
LiveHuman, 2015-11-29 22:05:33

How can I make it so that when the button is clicked, changes are made to the modal window?

When I press the button, this modal window opens with feedback (code below), there are no problems with this. But how to make it so that when you click on the same button (the code is even lower), the same form opens, but only new text is automatically written there, for example, which was screwed exclusively to the button. Can you provide a code example? PS I found something similar, I tried to install it but it did not work.

<!-- Окно обратной связи --> 
<form class="cd-form floating-labels" method="post" action="connect.php">
    <fieldset>
      <legend>Форма обратной связи</legend>

      <div class="error-message">
        <p>Please enter a valid email address</p>
      </div>

      <div class="icon">
        <label class="cd-label" for="cd-name">Введите ваше имя или псевдоним</label>
        <input class="user" type="text" name="cd-name" id="cd-name" required>
        </div> 

        <div class="icon">
        	<label class="cd-label" for="cd-company">Company</label>
        <input class="company" type="text" name="cd-company" id="cd-company">
        </div> 

        <div class="icon">
        	<label class="cd-label" for="cd-email">Email</label>
        <input class="email error" type="email" name="cd-email" id="cd-email" required>
        </div>
    </fieldset>

    <fieldset>
      <legend>Project Info</legend>

      <div>
        <h4>Budget</h4>

        <p class="cd-select icon">
          <select class="budget">
            <option value="0">Select Budget</option>
            <option value="1">&lt; $5000</option>
            <option value="2">$5000 - $10000</option>
            <option value="3">&gt; $10000</option>
          </select>
        </p>
      </div> 
<!-- вот тут например -->
    <div>
                <ul class="cd-form-list">
          <li>
            <input type="checkbox" id="cd-checkbox-1" onclick="this.form.submit.disabled=0;"/>
            <label for="cd-checkbox-1">Я ознакомлен с&nbsp;</label><a href="/confirmation.html" target="_blank">ПОЛЬЗОВАТЕЛЬСКИМ СОГЛАШЕНИЕМ</a>
          </li>
      </div>
               <div class="icon">
        <label class="cd-label" for="cd-textarea">Project description</label>
      			<textarea class="message" name="cd-textarea" id="cd-textarea" required></textarea>
      </div>

      <div>
          	<input type="submit" value="Отправить" id="submit" disabled="disabled">
        </div>
    </fieldset>
  </form>
<!-- сама кнопка -->
<div class="buttons">
<a class="btn btn-danger btn-lg btn-block" href="#"  data-toggle="modal" data-target="#basicModal">Заказать</a></div>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2015-11-29
@gangstarcj

$("a.button").click(function() {
$("div").html("<p>Новый текст</p>");
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question