|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi, I'm kinda new to JavaScript, so it's the syntax that's got to be stumping me.
I've got the following function in an external file that contains other (working) scripts: function billEQmail () { form = document.forms[0]; if (form.billEQmail.checked) { // copy mailing info to billing fields form.Baddress.value = form.Maddress.value; form.Bcity.value = form.Mcity.value; form.Bstate.value = form.Mstate.value; form.Bzip.value = form.Mzip.value; form.Bphone.value = form.Mphone.value; form.Bemail.value = form.Email.value; } else { // clear billing fields form.Baddress.value = ""; form.Bcity.value = ""; form.Bstate.value = ""; form.Bzip.value = ""; form.Bphone.value = ""; form.Bemail.value = ""; } } as you can see, all it does is copy fields to a series of other fields, or clear them... When I load it up, Netscape's Javascript Console says "billEQmail is not a function". Like I said, this function is defined in the same file as several other functions that are working fine. I can't see any problems in the syntax, but if you can help me out, I'd appreciate it. Thanks! |
|
#2
|
|||
|
|||
|
function billEQmail ()
There is a space between "billEQmail" and "()". Try it when you remove the space |
|
#3
|
|||
|
|||
|
no, the other functions have the same format... any other ideas?
|
|
#4
|
|||
|
|||
|
hi ryanh
netscape may not understand referencing forms as a collection you may want to try something like this: document.formB.Bzip.value = document.formM.Mzip.value; document.formB.Bphone.value = document.formM.Mphone.value; document.formB.Bemail.value = document.formM.Memail.value; for forms... <form name="formB"> <input type="text" name="Bzip" value="">Zip<br> <input type="text" name="Bphone" value="">Phone<br> <input type="text" name="Bemail" value="">Email<br> </form> and... <form name="formM"> <input type="text" name="Mzip" value="99923">Zip<br> <input type="text" name="Mphone" value="342-8291">Phone<br> <input type="text" name="Memail" value="me@lalala.com">Email<br> </form> this does not really address your question i suppose as the error your are getting sounds like something different but maybe this could help ps i tested this in IE.. i try and avoid netscape like the plague so this probably won't work either |
|
#5
|
|||
|
|||
|
JS is such a pain in the ***... apparently, it didn't like the name billEQmail... I changed it to copyAddress, and it worked perfectly...
grrrrrrr... |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > xxxx is not a function... ???? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|