glicose Posted December 1, 2009 at 12:31 PM Report Share #298200 Posted December 1, 2009 at 12:31 PM Olá, eu estou precisando de um botão que passe um parametro no submit while($linha=mysql_fetch_array($busca)){ $item_id=$linha[item_id]; ?> <tr> <td><?=$linha[prod_nome]?></td> <td><?=$linha[prod_preco]?></td> <td><input type="image" src="../images/bt_alterar.gif"</td> <tr> <? } ?> A idéia era passar um índice pro botão, pra poder atualizar apenas o valor de 1 produto Como poderia fazer isso? Grato APARTE: Usa o Geshi, torna o post mais apresentável. 🙂 Link to comment Share on other sites More sharing options...
scorch Posted December 1, 2009 at 01:19 PM Report Share #298209 Posted December 1, 2009 at 01:19 PM Não percebi. Podias explicar melhor, sff. 🙂 PS: Não respondo a perguntas por mensagem que podem ser respondidas no fórum. Link to comment Share on other sites More sharing options...
glicose Posted December 1, 2009 at 02:23 PM Author Report Share #298220 Posted December 1, 2009 at 02:23 PM Consegui resolver com aquele javascript que vc respondeu no outro post só implementei essa linha: <td><input type="image" src="../images/bt_alterar.gif" onclick="addind('indice','<?=$item_id?>')"></td> usando esse javascript: function addind(divName, indice){ var newdiv = document.createElement('div'); newdiv.innerHTML = '<input type="hidden" name="indice" value="'+indice+'">'; document.getElementById(divName).appendChild(newdiv); } Será que tem algum jeito melhor? Aonde eu acho esse Geshi, eu procurei aqui mas não achei...É um botão? Grato Link to comment Share on other sites More sharing options...
scorch Posted December 1, 2009 at 02:27 PM Report Share #298222 Posted December 1, 2009 at 02:27 PM Geshi. 🙂 Quanto à resolução, não trabalho muito com JavaScript, mas sim, assim está bem. 😉 PS: Não respondo a perguntas por mensagem que podem ser respondidas no fórum. Link to comment Share on other sites More sharing options...
scorch Posted December 1, 2009 at 08:34 PM Report Share #298312 Posted December 1, 2009 at 08:34 PM Glicose, dividi os tópicos. A tua segunda questão está aqui: 🙂 http://www.portugal-a-programar.pt/index.php?showtopic=31471 PS: Não respondo a perguntas por mensagem que podem ser respondidas no fórum. Link to comment Share on other sites More sharing options...
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