br Posted July 26, 2013 at 11:31 AM Report #520062 Posted July 26, 2013 at 11:31 AM (edited) boa tarde tenho um form mas quero adicionar varias vezes estes elementos e chamar sempre a mesma funçao no submit mas assim nao da, pois os ids teem que ser unicos. como posso fazer isto funcionar so um form? <form name="frmTranslations" action="javascript:insert()" method="post"> <table border ='1'> <tr><td>Text</td><td>Translation</td></tr> <?php while ($translations = mysql_fetch_array($result)){ echo "<tr><td>"; echo "<input name='idEng' type='hidden' id='idEng' value='".$translations["EnglishID"]."'/>"; echo $translations["strText"]."</td><td>"; echo "<input name='txtTrans' type='text' id='txtTrans' value=''/>"; echo "<input name='submit' type='submit' value='Insert'/></td></tr>"; } ?> </table> </form> cumprimentos Edited July 28, 2013 at 07:56 AM by brunoais geshi
Diogo Henrique Posted July 26, 2013 at 12:29 PM Report #520065 Posted July 26, 2013 at 12:29 PM Chamas com o post o submit. Fica assim: $variável=$_POST['submit']; Espero ter ajudado 🙂
HappyHippyHippo Posted July 26, 2013 at 12:53 PM Report #520066 Posted July 26, 2013 at 12:53 PM o que faz a função ? IRC : sim, é algo que ainda existe >> #p@p Portugol Plus
br Posted July 26, 2013 at 01:13 PM Author Report #520069 Posted July 26, 2013 at 01:13 PM eu quero um form para completar uma tabela a função passa-me so os valores e chama uma pagina php para guardar na bd existe alguma forma de passar os ids do input para um array?
br Posted July 26, 2013 at 01:58 PM Author Report #520079 Posted July 26, 2013 at 01:58 PM (edited) Eu consigo fazer um a um <form name="frmTranslations<?php echo $i; ?>" action="<?php echo $_SERVER['PHP_SELF']."?add=true"; ?>" method="post"> <input name="idEng" type="hidden" id="<?php echo "idEng[".$i."]"; ?>" value="<?php echo $translations["EnglishID"]; ?>"/> <?php echo $translations["strText"]; ?> <input name="txtTrans" type="text" id="<?php echo "txtTrans[".$i."]"; ?>" /> <input name="submit" type="submit" value="Insert" /> </form> mas como posso fazer so com um form e so um submit? Edited July 27, 2013 at 10:17 PM by brunoais geshi
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now