September 13, 200719 yr Hi, please help me. I have a few forms and I need send there forms by one submit input. for example <form> <input type="text" value="1" name="id" id="id" /> </form> <form> <input type="text" value="2" name="id" id="id" /> </form> <form> <input type="text" value="3" name="id" id="id" /> </form> and this i need send by one submit input. Thx
September 13, 200719 yr You can't do that. A submit button will only send the data for its form. And you should not have elements with the same id field. <form> <input type="text" value="1" name="id1" id="id1" /> <input type="text" value="2" name="id2" id="id2" /> <input type="text" value="3" name="id3" id="id3" /> </form> Try something like this.
September 13, 200719 yr Author I have only this ID :/ I(probably) need some javascript, but I dont know how write it :/ When I have id1,id2 I dont wrote this but thanks
September 13, 200719 yr I'm not sure if you can even use javascript to trigger all the forms. As soon as the first one is triggered the page will process. And it's bad for accessibility to rely on javascript. Can you explain what you're trying to do. Why do you have many forms you need to submit at the same time? I got a feeling there's a better way.
September 13, 200719 yr you can use javascript to trigger all the forms. Create a button that calls a javascript function. then in that function do function submitform() { document.form1.submit(); document.form2.submit(); } that MIGHT work but you really shouldn't be submitting many forms. what do you mean you only have this id?
September 13, 200719 yr you can use javascript to trigger all the forms. Create a button that calls a javascript function. then in that function do function submitform() { document.form1.submit(); document.form2.submit(); } that MIGHT work but you really shouldn't be submitting many forms. what do you mean you only have this id? I'm just thinking that you might actualy just get the results from the first form...
September 13, 200719 yr most likely but if it can be done then that's how. I still can't think of a single reason for having many forms like that. The only point of seperate forms is seperate submissions.
September 13, 200719 yr you could ajax-submit the forms... however, I really can't see any justifiable reason to have it split into 3 forms... explain what led you to this soluton?
September 14, 200719 yr Also, IF all the form where submitted, the elements with the same ID would override each other. So the solution doesn't make sense. We need to know what you're trying to accomplish here.
Create an account or sign in to comment