Almost have it, but I need help!

Results 1 to 2 of 2

Thread: Almost have it, but I need help!

  1. #1
    PJ Guest

    Default Almost have it, but I need help!

    I&#039;m trying to get this basic function to simply return focus to the field that is being validated. I have demonstrated with alert boxes that it correctly identifies the form name, field name, and field value.<BR><BR>=========<BR>function isValidDate(formData) {<BR>var theForm =<BR>var theField =<BR>var theValue = formData.value<BR>alert(formValue);<BR> rmname.fieldname.focus();<BR>}<BR>================ <BR><BR>The problem is that I am having trouble making formname and fieldname dynamic. I&#039;ve tried:<BR>document.theForm.theField.focus();<BR>do cument.&theForm&.&theField&.focus();<BR>document.& &theForm&&.&&theField&&.focus();<BR><BR>You can see it&#039;s just a syntax problem. I&#039;ve got "Mastering JavaScript" by James Jaworski here, and I can&#039;t find the answer.<BR><BR>Can you help?<BR><BR>Thanks!<BR>PJ<BR>

  2. #2
    PJ Guest

    Default Figured it out - here's the solution

    formData.focus();<BR><BR><BR>can you believe it was that simple?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts