Passing JavaScript Arguements

Results 1 to 2 of 2

Thread: Passing JavaScript Arguements

  1. #1
    Join Date
    Dec 1969

    Default Passing JavaScript Arguements

    I am trying to pass the following arguement. <BR><BR>onChange = sublist(document.subad.subcatagory&#060;%=number%& #062;.name)<BR><BR>Is there any obvious reason why it would&#039nt work in the following line. Obviously not all the code is here, but should it be possible to pass a string as an arguement and then use it in the following line to identify an object name? <BR><BR> function sublist(subcat) <BR> { <BR> this.form.subcat.length = 0 <BR> } <BR><BR>I have also definately not used &#039subcat&#039 anywhere else. Many thanks.<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Passing JavaScript Arguements

    language police : category and arguments - not the way you spelled them.<BR><BR>the answer :<BR><BR>function sublist(subcat) { <BR>this.form.elements[subcat].length = 0 <BR>} <BR><BR>the reason : what you&#039re passing is a string, not an object reference.<BR><BR>j<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