avvishnu wrote:i need to get the value of a button. the button is in a loop and each time its value is increased. how can i get the button value.
please help me
code :
<input name="orginfo" type="submit" id="orginfo" value="<?php $count=$count+1 ; ?>" onclick="javascript:<?php // HERE IS THE CODE NEED TO GET THE VALUE OF THE BUTTON .?>"/>
a v vishnu
<form action='getvalue.php'>
<?php
$cnt=1;
?>
[LOOP]
<input name="orginfo<?php echo $cnt;?>" type="submit" id="orginfo" value="<?php $count=$count+1 ; ?>" onclick="javascript:<?php // HERE IS THE CODE NEED TO GET THE VALUE OF THE BUTTON .?>"/>
$cnt++;
[LOOP]
<input type='hidden' name='maxcnt' value='<?php echo $cnt;?>'>
</form>
getvalue.php
<?php
$maxCnt = $_REQUEST['maxcnt'];
for($i=1;$i<=$maxCnt;$i++)
{
echo $_REQUEST['orginfo$i'];
}
?>
CHECK is it working...
But one suggession...
The way you are writting the code is not good... yaar...
means loop etc etc...
any wayz.. nice question...
BUT suggest you to go throught PHP, JAVASCRIPT and HTMTML (BASICS) first...
Then - u can easily able to know what to use where..
AND here ... THE question you asked... we can solve that using java script....
regards
Dharam