MemoryRefresh!

Dinamicaly add element



Questions Answers 0%

Pages   0 from 18
Questions   0 from 23

Reset




<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></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>
Questions

Related pages

Form add element !
Input set value !
Two select related !
Get all elements !
Checkbox checked !
Dinamicaly add element !
Set get value !


0% 100%
 
 
0 pages 18 pages
No questions


<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></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>



More from Jquery

Window
Attributes
Data
Effects
Element
Basics
Ajax
Form
Uncategorized


More from Programming

Php
jQuery




Powered by minte9.com