formatting problems?

Results 1 to 2 of 2

Thread: formatting problems?

  1. #1
    Join Date
    Dec 1969

    Default formatting problems?

    can someone help me here im quite new to javascript and am running into some problems. im getting an "expected &#039;)&#039;" runtime error. the code is as follows:<BR><BR> function changeVal()<BR>{<BR><BR> for(i=0; i&#060;myForm.PrjID.length; i++)<BR> {<BR> strmatch=String(myForm.PrjID.options[i].text.substring(0,myForm.txtSearch.value.length)); <BR><BR> if (myForm.txtSearch.value.match(RegExp(strmatch, "i")))<BR> { <BR> <BR> myForm.PrjID.value = myForm.PrjID.options[i].value;<BR> i=myForm.PrjID.length;<BR> } <BR> }<BR>}<BR><BR><BR>the error is happening in the "if" line. ive tried just about every imaginable variation of this code but cant get the text object to match. for instance if i replace a simple string ("string") in place of the var strmatch this works fine. can anyone give me some pointers here?

  2. #2
    Join Date
    Dec 1969

    Default RE: formatting problems?

    Do a view source and give us the html and JS. I&#039;m not sure what your goal is, but is it necessary to use the String object? Why not just use the value?

Posting Permissions

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