Let me preface this by saying im a PHP programmer, I dont know any javascript, at all.. Ive seen a tutorial on the net about adding and subtracting divs from a page, I guess it could similar but as I said before, I dont know javascript and even how to edit a pre made script... What im looking for is something that will do the following: There will be 5 Certifications standard, each Certification has 2 text input fields, the Cert name and Cert Expiration Date. I would like under the 5th to have a link that says "Add another Certification", if they click that, it will give 2 more fields, one for the cert name and cert date. I would like this to happen til they have 20 total on the page. If anyone would be willing to do that I would appreciate it greatly...
Any PHP programmer knows some javascript. why don't you search for some JS manuals and read them? google is your friend!!
<script language="javascript"> nr=5; function addCertification(nr){ if(nr<=20){ holder=document.getElementById("your_certifications_holder"); holder.innerHTML+="Some label <input type='text' name='certification1"+nr+"' /><br />"; holder.innerHTML+="Some label2 <input type='text' name='certification2"+nr+"' />"; } } </script> <a href="#" onclick="addCertification(nr)">Add another Certification</a>
bibel thank you so much, after a little setting up that script worked perfect, the only thing is that it doesnt seem to be incrementing the number, I tried doing: nr++; at the end of the if statement but it didnt seem to help