Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Use <a href=...> to submit form

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Use <a href=...> to submit form

Postby Takeshi » Fri Nov 08, 2013 1:20 pm

Hello everyone,

I have a little problem I can not solve. So this is the code ...
<form id=id_form method=post action=../forum/page2.php>
<INPUT TYPE=HIDDEN NAME='ID' value=<?php echo $db['id']; ?> />
<a href="#" onclick="document.forms['id_form'].submit();">
<?php echo $db['id']; ?>
</a>
</form>

table .. (forexample...)
_____
1
2
3
...
_____

... the proble is .... when I use <a href=...> as to submit form ... and I click on (forexample) <a>3</a> or <a>2</a> a link, it show me everytime the first value "1" ... BUT if I user <input type=submit> instead <a href=> it works correctly ... It means ... when I click on 5-link, it shows me 5-value
... so I dont understand why

.... I hope you understand what I need ... thanks a lot
Takeshi
New php-forum User
New php-forum User
 
Posts: 7
Joined: Fri May 17, 2013 3:07 am

Re: Use <a href=...> to submit form

Postby Takeshi » Mon Nov 11, 2013 7:52 am

Finaly I I solved it in a simply way ... I make ordinary button looks like an a link ... with css
Takeshi
New php-forum User
New php-forum User
 
Posts: 7
Joined: Fri May 17, 2013 3:07 am


Return to PHP coding => General

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.