Jump to content

Printing javascript value


graham23s

Recommended Posts

Hi Guys,

 

I'm trying to pass the value of a bit of javascript via php, my code:

 

								<div style="width: 20px; height: 10px;"><a href="javascript:void(0)" onclick="theNumber++; document.getElementById('specqty').value = theNumber;"><img src="../images/spQtyUp.gif" width="20" height="10" border="0" alt="Up" /></a></div>
								<div style="width: 20px; height: 10px;"><a href="javascript:void(0)" onclick="theNumber--; if(theNumber<1){theNumber=1;}; document.getElementById('specqty').value = theNumber; "><img src="../images/spQtyDown.gif" width="20" height="10" border="0" alt="Down" /></a></div>
							  <input type="hidden" name="qID" value="<?php echo ; ?>" />	

 

document.getElementById('specqty').value i'm trying to print this value in the "hidden" qID field to be passed over one the "add to cart" button is pressed i'm not sure how to write the javascript value in the php echo part (

 

any help would be appreciated

 

thanks guys

 

Graham

 

Link to comment
https://forums.phpfreaks.com/topic/202184-printing-javascript-value/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.