View Full Version : dynamic submit action help

05-20-2011, 06:17 PM
hello!i will try to explain my problem here!forgive me from mu english :P
i want to create buttons depented on some field in mysql.i managed to pass the variable value (how many buttons to make) with php and javascript.Now i want for each button to make show some data from mysql! my problem is how to make each button act deferently?i try this
function addsubmit (fid)
{ for (i=0;i<num;i++){ //num is how many buttons to create

var newsubmit = document.createElement("input");
newsubmit.type = "submit";
newsubmit.id = "mysubmit"&+submitCount;
newsubmit.name = "mysubmit";
newsubmit.value =i;
and i call in body <body onLoad="return addsubmit(myform1)";>
how can i make each button to call a function with maybe some parameter to show my results ? tnx in advance!!