Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-23-2011, 02:26 PM   PM User | #1
katti
New to the CF scene

 
Join Date: May 2011
Posts: 3
Thanks: 2
Thanked 0 Times in 0 Posts
katti is an unknown quantity at this point
help with javascript-arrows for increase/decrease

Hi I'm completely stuck, I am looking for placing small
up and down arrows next to my textbox. They would work with by increasing/decreasing number of products. The text box would be active so a client could put the number of a product himself/herself or simply by clicking the up/down arrows next to the text box.

I am not sure how to look for it, I mean I thought something like that should exist by default, I search w3c and I can find only combo box etc.
Could someone put me on the right track please?..
katti is offline   Reply With Quote
Old 07-23-2011, 03:36 PM   PM User | #2
vwphillips
Senior Coder

 
Join Date: Mar 2005
Location: Portsmouth UK
Posts: 4,358
Thanks: 3
Thanked 458 Times in 445 Posts
vwphillips is a jewel in the roughvwphillips is a jewel in the roughvwphillips is a jewel in the rough
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
  <title></title>
<script type="text/javascript">
/*<![CDATA[*/

function Add(id,ud){
 var obj=document.getElementById(id);
 obj.value=obj.value.replace(/\D/g,'');
 obj.value=Math.max((obj.value=obj.value||'0')*1+ud,0);;
}
/*]]>*/
</script></head>

<body>
<form >
<input name="number"  id="number" />
   <img alt="Up" class="butV" id="up" src="http://www.vicsjavascripts.org.uk/StdImages/Up1.gif" onmouseup="Add('number',1);" />
  <img alt="Down" class="butV" id="down" src="http://www.vicsjavascripts.org.uk/StdImages/Down1.gif" onmouseup="Add('number',-1);" />

</form>
</body>

</html>
__________________
Vic

God Loves You and will never love you less.

http://www.vicsjavascripts.org.uk/

If my post has been useful please donate to http://www.operationsmile.org.uk/
vwphillips is offline   Reply With Quote
Users who have thanked vwphillips for this post:
katti (07-23-2011)
Reply

Bookmarks

Tags
input, javascript, menu, populate quantity

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:10 PM.


Advertisement
Log in to turn off these ads.