MemoryRefresh!

Form / Dinamicaly add element     Dinamicaly add element



Questions Answers 0%

Pages   0 from 16
Questions   0 from 21

Reset



<script type="text/javascript" src="code.jquery.com"></script> <a href="#" onClick="addFormField();">Add</a> <input type="hidden" id="fieldOrder" value="1"> <div id="divTxt"></div> <script> function addFormField() { var id = $("#fieldOrder").val(); $("#divTxt").append( "<p id='row" + id + "'>" + id + "<input type='text' size='3'>" + "<a href='#' onClick='removeFormField("#row" + id + "");'>Remove</a>" + "<p>" ); id = (id-1) + 2; $("#fieldOrder").val(id); } function removeFormField(id) { $(id).remove(); } </script>
No questions



<script type="text/javascript" src="code.jquery.com"></script> <a href="#" onClick="addFormField();">Add</a> <input type="hidden" id="fieldOrder" value="1"> <div id="divTxt"></div> <script> function addFormField() { var id = $("#fieldOrder").val(); $("#divTxt").append( "<p id='row" + id + "'>" + id + "<input type='text' size='3'>" + "<a href='#' onClick='removeFormField("#row" + id + "");'>Remove</a>" + "<p>" ); id = (id-1) + 2; $("#fieldOrder").val(id); } function removeFormField(id) { $(id).remove(); } </script>





Programming

Php
   
Regex
   
MySQL
   
Css
   
jQuery
   
Git
   


References
n/a