Quick JS Ques

Results 1 to 2 of 2

Thread: Quick JS Ques

  1. #1
    Join Date
    Dec 1969

    Default Quick JS Ques

    does anyone know if there is a quick way to determine the type of a given named form element?<BR><BR>For example,<BR><BR>if (document.frm.input1.type = text) <BR><BR>or something to that effect.

  2. #2
    Join Date
    Dec 1969

    Default You answered your own question

    If you had just done<BR><BR>alert( "type of input1 is " + document.frm.input1.type );<BR><BR>you&#039;d see the answer.<BR><BR>Note: In JS, types are *strings*, not keywords, so you have to compare vs. a string.<BR><BR>Oh...and if you really used this code:<BR><BR>if (document.frm.input1.type = text) <BR><BR>even changing text to "text", you wouldn&#039;t get meaningful results. Can you see why?<BR><BR>

Posting Permissions

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