This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: xml and javascript


Hi Stevenson,

> i have this javascript:
>
> if( document.FilterForm.Search.value != "" )
>                 {
>                         iSearch = document.FilterForm.Search.value;
>                         sFilterString = sFilterString + "[" +
> "contains(Description, iSearch)" + "]"
>                         alert( iSearch )
>                 }
>
> what am trying to do is pass the value of iSearch in to my contains
> function but doesn't seem to pick it up. What could be the problem?

You're currently adding the string "[contains(Description, iSearch)]"
to your sFilterString rather than inserting the value of the iSearch
variable. You need:

  sFilterString = sFilterString + "[" + "contains(Description, " +
                  iSearch + ")" + "]"

I hope that fixes it,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]