Skip to content

Instantly share code, notes, and snippets.

@tosinonikute
Last active August 30, 2018 12:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tosinonikute/732ce90b5aec98e8f29f8a8df5df3645 to your computer and use it in GitHub Desktop.
Save tosinonikute/732ce90b5aec98e8f29f8a8df5df3645 to your computer and use it in GitHub Desktop.
<!--
PHP
if(isset($_POST['question'])){
$question = $_POST['question'];
foreach($question as $q){
}
}
-->
<style>
.btn-question{
color: #000 !important;
}
.btn-question:hover {
box-shadow: none !important;
}
</style>
<div class="question-div">
<label class='col-xs-12 extra-ques'>
<div class='col-xs-9'>
<label class="col-xs-12 "><input type="text" name="question[]" class="form-control" /></label>
</label>
</div>
<button type="button" class="btn secondry add-role ask-another-question">Ask another question</button>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script>
$( document ).ready(function() {
$('.ask-another-question').click(function(){
$('.question-div').append( "<label class='col-xs-12'><div class='col-xs-9'><input type='text' name='question[]' class='form-control' /></div><div class='col-xs-3'><button type='button' class='btn btn-cancel btn-question form-control remove-question'>Remove</button></div></label>" );
});
$(document).on('click', '.remove-question' ,function(){
$(this).parent().parent().remove();
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment