Hi Folks

I am trying to add a spin control to my quantity field before i add the ordered quantity to a shop cart array.

The way its set up at the moment if you click the deincrement arrow it actually goes into negative numbers. (no good coz people cant order a negative number eh#$@#$@)
This the

<head> Code
<!---sPIN BUTTONS TO UP QUANTITY--->
<script type="text/javascript">
function changeVal(n) {
			document.forms[0].quantity.value =parseInt(document.forms[0].quantity.value) + n;
			}
			
	</script>

AND this is in my formfield:
                        <td ><input name="quantity" type="text" class="quantity" value="1" onFocus="this.blur();" ></td>
                        <td style="width:14px;">
						<table cellpadding="0" cellspacing="0">
             		   <td width="28"><img src="siteImages/btn_up.gif" width="14" height="9" hspace="0" vspace="0" border="0" onClick="changeVal(1);"></td>
            	      </tr>
        	          <tr>
             	     <td><img src="siteImages/btn_down.gif" width="14" height="9" border="0" hspace="0" vspace="0" onClick="changeVal(-1);"></td>
          	         </tr>

How can i set this to a Minimum of 1 in the field please.
I have found this in about 4 hours of googling:- document.forms[0].quantity ({min:1}); and have tried adding this in all sorts of combinations but i still get those negative numbers

Can Anyone PLEASE help this "java DDumb Ar// out please
cheers and thanks in advance
Grabit

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.