Hey all, I have a form on my website which is used to send me link ideas. Recently i had a request to have a multiple submission option. So that they could send me more than 5 links at the same time without having to click submit for every single one. Hope you're still following me here Is that possible with javascript? And if so, any direction you can point me in?
This is just a concept, probably not functional code <script type="text/javascript"> var count = 3; // however many forms you want to load the page with function addForm(count){ var formarea = document.getElementById("formArea"); count++; var add_this = "<input type='text' name='link_"+count+"' /><br/><br/>"; formarea.innerHTML = formarea.innerHTML + add_this; } </script> <div id="formArea"> <input type="text" name="link_1"><br/><br/> <input type="text" name="link_2"><br/><br/> <input type="text" name="link_3"><br/><br/> </div> <a href="#add_form" onclick="addForm(count)">Add More Fields</a> Code (markup): just a thought, who knows
I'll give it a try and play around with it Thanks Edit: It does indeed work as far as adding more fields go Which is exactly what i need. Now to come up with a way to change it so that i can use it hmm Thanks again
in php, just use a loop and check something like if(isset($_POST['link_'.$i)){ and then keep increasing I so it keeps checking for more forms until it gets to one that hasn't been set