[thelist] js form validation problem - still not working

Karen J. Bowen karen at miinx.com.au
Mon Jun 17 00:15:01 CDT 2002


Thanks for your response Burhan!

Great catch with the apostrophe - that has fixed the IE error, thankyou!
  Still having no luck with the focus thing though.

You asked:
 > Did you try flipping the select() and focus()? Having it
 > set focus first, and then select()?

and yep, tried swapping them, also tried every possible (I think)
combination of return values (putting it in the function call, putting
it in the function, returning true/false, returning the focus() or
select() statement, etc).  All no good.  :(

Obviously I could do this differently.  But this is the most simple
solution, and I have done this before ad infinitum with no prob so am
baffled as to why this is not working now.

Anyone else?  Here is the page again:
http://www.cellaredportfolio.com.au/winestock.asp

and the pretty straight-forward js:
http://www.cellaredportfolio.com.au/js/nl.js

The problem is when you enter a non-number into a text box, the js
validation routine is returning you to the *next* element.

Thanks again,
Karen


Burhan Khalid wrote:
> 3. On my box (IE 6 XP Pro), it showed the missing ) error only once.
> When I hit refresh, the error didn't show up. However, I think your
> error is because you have two (') in your field. Try escaping one of
> them, or using the double-quote trick.
>
> What you've got :
> onchange="chkStockNum(this, 8, '1998 Kay's Amery Block 6 Shiraz')"
>
> Option 1 :
> onchange="chkStockNum(this, 8, '1998 Kay\'s Amery Block 6 Shiraz')"
>
> Option 2 :
> onchange='chkStockNum(this, 8, "1998 Kay's Amery Block 6 Shiraz")'
> I /think/ this will work (haven't messed with js for a while).




More information about the thelist mailing list