Expand|Select|Wrap|Line Numbers
- <script language="JavaScript" type="text/JavaScript"><!--
- // Word Count Function
- function cnt(w,x){
- var y=w.value;
- var r = 0;
- a=y.replace(/\s/g,' ');
- a=a.split(' ');
- for (z=0; z<a.length; z++) {if (a[z].length > 0) r++;}
- x.value=r;
- }
- //--></script>
- <form name="form" action="http://www.xyz.com/sc/cart.cgi" method="post">
- Ad Content: <textarea onkeyup="cnt(this,document.form.op3)" name="op31"></textarea>
- Word Count: <input value="0" name="op3" />
- Ad Cost: <input value="0" name="op4" />
- <input type="image" src="../../UploadedImages/ShoppingCartButtons/addtocart.gif" name="add" /></p>
- </form>
If op3 = 1-150, $200
151-300, $350
301-450, $500
451-600, $650
>600 = invalid
Everything function I have tried either makes cnt() not show the word count in op3 or does nothing at all.