[thelist] js form validation problem - still not working

Burhan Khalid burhankhalid at members.evolt.org
Sat Jun 15 13:27:01 CDT 2002


Hey Karen :

	I liked your site. Good presentation, IMO. Thought I'd help you
out with your problem. Found some interesting things :

1. If you hit enter, your get the correct focus(), but the form sumbits!
2. If you click on the next textbox, then the focus is on /that/ field,
and not the previous one (like you'd wanted).
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).

I'll see if I can figure out your focus() thing.
hth,
Burhan





More information about the thelist mailing list