Forum Moderators: open

Message Too Old, No Replies

Help with form using option and links

links with variables

         

finoo

1:29 pm on Jun 6, 2007 (gmt 0)

10+ Year Member



Check this code, using this doesn't work. Any idea what im doing wrong?

Links look like : /invoice_take_1.php?SelectURL=invoice_take_1.php%3Faction%3Dsend_faktura%26unique_id%3D11%26customer_number%3D15000

Shold look like :
/invoice_take_1.php?action=send_faktura&unique_id=11&customer_number=15000

<FORM NAME=\"nav\"><DIV>
<SELECT NAME=\"SelectURL\" onChange=
\"document.location.href=
document.nav.SelectURL.options[document.nav.SelectURL.selectedIndex].value\">
<OPTION VALUE=\"http://www.webmasterworld.com/\" SELECTED>choose
<OPTION VALUE=\"invoice_take_1.php?action=send_faktura&unique_id=$unique_id&customer_number={$in['cust_number']}\"> send invoice

</SELECT></DIV>
<INPUT TYPE=\"SUBMIT\" VALUE=\"Go!\">
</FORM>

colandy

2:08 pm on Jun 6, 2007 (gmt 0)

10+ Year Member



Are the $unique_id and $in['customer_number'] PHP variables or Javascript Variables. Or even some other type.

Assuming they are PHP the following should work:

<OPTION VALUE="invoice_take_1.php?action=send_faktura&unique_id=<?php=$unique_id;?>&customer_number=<?php=$in['cust_number'];?>"> send invoice</OPTION>

If they are Javascript then you would need to create the select and option bowes from with javascript. Unless someone more intellectual than me can come up with a way of adding Javascript within the Option value.