help!!! thx

Results 1 to 3 of 3

Thread: help!!! thx

  1. #1
    Join Date
    Dec 1969

    Default help!!! thx

    if the checked box <BR>&#060;input type="checkbox" name="mobile" value="motorola" &#062; <BR>&#060;input type="checkbox" name="mobile" value="ericsson" &#062; <BR>&#060;input type="checkbox" name="mobile" value="samsung" &#062; <BR>&#060;input type="checkbox" name="mobile" value="philips" &#062; <BR>is checked and <BR>&#060;form method="POST" action="showphone.asp"&#062; <BR><BR>in the showphone.asp <BR>&#060;%<BR>Dim strWhere <BR>StrWhere=Request.form("mobile") <BR>strWhere=Replace(StrWhere,",","=1 AND ")<BR>response.write strWhere<BR>%&#062;<BR><BR>it returns<BR>motorola=1 AND ericsson=1 AND samsung=1 AND philips<BR>&#060;-------problem---------&#062;<BR>but i want is<BR>motorola=1 AND ericsson=1 AND samsung=1 AND philips=1<BR><BR>also if only motorola is selected<BR>it returns<BR>motorola<BR>this time i want is<BR>&#060;--------problem-------&#062;<BR>motorola=1<BR><BR>can someone tell me how to fix<BR><BR>thank you

  2. #2
    Join Date
    Dec 1969

    Default RE: help!!! thx

    Haven&#039t figured it out, but I know the problem.<BR><BR>You are replacing the comma with "=1 and"<BR><BR>the problem comes because there is no comma after philips<BR><BR>sorry if you knew that already, but it took me this long to figure that out.<BR><BR>I think there might be something on the faq&#039s about this, i read about it here once before

  3. #3
    Anil Tumati Guest

    Default RE: help!!! thx

    As u are replacting the Commas , there is no comma after the last one, so u have to manually add<BR><BR>After This Statement<BR>strWhere=Replace(StrWhere,",","=1 AND ")<BR>Add the Below Code<BR>if not strWhere = ""<BR>strWhere = strWhere & "=1"<BR>end if<BR><BR>What i Trying to do here is to check if something is selected and then only add<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