|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
JS validation Guru PLEASE !!
Hi Folks
Can I do the following please: In have a form for entering payments of invoices. If they pay the whole ammount that is ok BUT if they only pay a part payment i wanna do the following. On the form i have radion buttons (partpay yes & no) - I have the validation in place where they must select one or the other. If they select yes i want an alert to show "enter this part payment in paidnotes" - This paid notes is a field also in the form. This field however could already contain text about a previous payment. What i need to do is send the focus of the "yes" radiobutton to the "paidnotes" field then check that they actually enter some text into that field - whether or not text already exists or not. As far as i can make out this would be an "onchange" event but i do not have the experience to understand just how to do it. Sorta like (in Plain english) if yes is checked - make sure they type sumpin into the textbox "paidnotes" whether it already contains text or not. The js validation i already have in place is (onsubmit) if(!document.form1.partpay[0].checked && !document.form1.partpay[1].checked){ alert("Is this A Part Payment or Not?") return false } if(document.form1.partpay[0].checked){ alert("DON'T FORGET To Record this Part Payment into the 'Part Payment Notes' Field"); document.form1.paidnotes.focus(); return false } PS "paidnotes" is a textbox field Can anyone please help me with this. cheers and thanks in advance Grabit |
|
#2
|
|||
|
|||
|
You may get a better response by asking this in the JavaScript forum, since that is dedicated to this sort of topic. Also, there are a number of existing validation libraries available (many as plugins to things like jQuery) that will probably do much more than anything you try to build up yourself.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > JS validation Guru PLEASE !! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|