I can't seem to figure this one out..
I am trying to use Javascript to select an input value. The problem is that the form is being looped through a php array that gets eve which makes every single form the same name and the inputs the name. The javascript will only let me get the value of the first form. I have tried putting the forms into arrays with [] but I cant't get it.. please help.
$find = mysql_query("
SELECT `name`, `desc`, LEFT(`desc`, 80),`price`, `page`, `id`
FROM `bang`
ORDER BY id ASC LIMIT 2 ") or die(mysql_error());
while($resultt= mysql_fetch_array($find)){
echo '<form id="linkcenter" action="">';
echo '<input type="hidden" value="'.$resultt['id'].'" id="linkcenterr" name="linkcenterr"';
echo '<input type="button" name="butn" value="Send" onClick="loadInfoo()">';
echo '</select>';
echo '</form>';
}
Javascript and jQuery in seperate file:
function loadInfoo() {
var id = document.getElementById('linkcenterr').value;
//ajax and more java bellow that i know is working..
}
All I am using the jquery for is to animate a box and then this input is going throught the javascript and sent to a php file which runs a sqlquery and echos all of the data from the database.
I know all the other code is working the problem is I don't know how to format these forms into an array so that the javascript can get each ones values when its clicked.