Page 1 of 3 123 LastLast
Results 1 to 15 of 42
  1. #1
    Join Date
    Jul 2004
    Posts
    494

    Unanswered: how to filter out unwanted selection in rs paging link

    Ok. Since The recordset paging didn't work as I had posted in my previous thread, I decided to look for a new sample code on paging. Thank God it worked. But I'm trying to figure out what to write in the page links:

    Code:
      response.write "<a href=""paging1.asp?page="&i&"&Keyword="
    & Keyword &"
    &Keywordb="& Keywordb &"
    &Keywordc="& Keywordc &"
    &spoke=" & spoke & "
    &book_spoke=Book_Spoke
    &chapter_spoke=Chapter_Spoke
    &verse_spoke=Verse_Spoke
    &text_data=yes
    &optAction=on"">"&i&"</a> "
    These:
    Code:
    &book_spoke=Book_Spoke
    &chapter_spoke=Chapter_Spoke
    &verse_spoke=Verse_Spoke
    are used by checkboxes as well as:
    Code:
    &text_data=yes
    But I'm not concerned about
    Code:
    &text_data=yes
    since I need it for every search.

    But is there a way to filter out the selection like the previous checkbox selections if they are not selected?

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    if I understand you right then yes.... instead of doing this...
    Code:
    response.write "<a href=""paging1.asp?page="&i&"&Keyword="
    & Keyword &"
    &Keywordb="& Keywordb &"
    &Keywordc="& Keywordc &"
    &spoke=" & spoke & "
    &book_spoke=Book_Spoke
    &chapter_spoke=Chapter_Spoke
    &verse_spoke=Verse_Spoke
    &text_data=yes
    &optAction=on"">"&i&"</a> "
    do something more like this...
    Code:
    pagingurl = "<a href=""paging1.asp?page="&i&"&Keyword="
    & Keyword &"
    &Keywordb="& Keywordb &"
    &Keywordc="& Keywordc
    
    if spoke<> "" then pagingurl = pagingurl & "&spoke=" & spoke
    
    if Book_Spoke <> "" then pagingurl = pagingurl & "&book_spoke=" & Book_Spoke
    if Chapter_Spoke<> "" then pagingurl = pagingurl & "&chapter_spoke=" & Chapter_Spoke
    if Verse_Spoke<> "" then pagingurl = pagingurl & "&verse_spoke=" & Verse_Spoke
    
    pagingurl = pagingurl & "&text_data=yes&optAction=on"">"&i&"</a> "
    response.write pagingurl

  3. #3
    Join Date
    Jul 2004
    Posts
    494

    please correct me...

    where do I go wrong?

    Code:
                   response.write "<a href=""" & Request.ServerVariables("SCRIPT_NAMES") & "?page="&i&"" &_
    "&Keyword="& Keyword &_
    "&Keywordb="& Keywordb &_
    "&Keywordc="& Keywordc &_
    "&text_data=yes" &_"
    if spoke<> "" then pagingurl = pagingurl" & "&spoke=" & spoke &_
    "if Book_Spoke <> "" then pagingurl = pagingurl" & "&book_spoke=" & Book_Spoke &_
    "if Chapter_Spoke<> "" then pagingurl = pagingurl" & "&chapter_spoke=" & Chapter_Spoke &_
    "if Verse_Spoke<> "" then pagingurl = pagingurl" & "&verse_spoke=" & Verse_Spoke &_
    "&optAction=on"">"&i&"</a> "

  4. #4
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    *sigh* you went wrong by trying to do it other then the way I suggested.

    You are trying to write out the URL before you have determine what the url should be. This is quite simply a very very very bad idea.

    The code I posted creates a variable and builds it (in the same way you build your sql string) and then only once it is complete does it get used.

    What you are trying to do (and I'm guessing here because it's a mess) is write out the url and build it at the same time and that will not work.

    Build first, then write it.

  5. #5
    Join Date
    Jul 2004
    Posts
    494
    ok I see what you did. I missed the "pagingurl ="

  6. #6
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    let me know how you get on.

  7. #7
    Join Date
    Jul 2004
    Posts
    494
    what do you think?
    Microsoft VBScript compilation error '800a0401'

    Expected end of statement

    /wheelofgod/kjvresp4.asp, line 261

    pagingurl = "<a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?page="&i&" & "&Keyword="& Keyword &"&Keywordb="& Keywordb &"&Keywordc="& Keywordc & if spoke<> "" then pagingurl = pagingurl & "&spoke=" & spoke & if Book_Spoke <> "" then pagingurl = pagingurl & "&book_spoke=" & Book_Spoke & if Chapter_Spoke<> "" then pagingurl = pagingurl & "&chapter_spoke=" & Chapter_Spoke & if Verse_Spoke<> "" then pagingurl = pagingurl & "&verse_spoke=" & Verse_Spoke & pagingurl = pagingurl & "&text_data=yes" & "&optAction=on""">"&i&"</a> "
    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^

  8. #8
    Join Date
    Jul 2004
    Posts
    494
    the arrow is under the 2nd " of "&text_data=yes"

  9. #9
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    you're going to drive me crazy gil...

    copy and paste this
    Code:
    pagingurl = "<a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?page="&i&" & "&Keyword="& Keyword &"&Keywordb="& Keywordb &"&Keywordc="& Keywordc
    
    if spoke<> "" then pagingurl = pagingurl & "&spoke=" & spoke
    
    if Book_Spoke <> "" then pagingurl = pagingurl & "&book_spoke=" & Book_Spoke
    
    if Chapter_Spoke<> "" then pagingurl = pagingurl & "&chapter_spoke=" & Chapter_Spoke
    
    if Verse_Spoke<> "" then pagingurl = pagingurl & "&verse_spoke=" & Verse_Spoke 
    
    pagingurl = pagingurl & "&text_data=yes" & "&optAction=on""">"&i&"</a> "

  10. #10
    Join Date
    Jul 2004
    Posts
    494
    Updating the paging:
    Code:
    pagingurl = "<a href=""" & 
    Request.ServerVariables("SCRIPT_NAME") & 
    
    "?page="&i&" & 
    
    "&Keyword="& Keyword &
    
    "&Keywordb="& Keywordb &
    
    "&Keywordc="& Keywordc & if spoke<> "" then pagingurl = pagingurl & 
    
    "&spoke=" & spoke & 
    
    if Book_Spoke <> "" then pagingurl = pagingurl &
    "&book_spoke=" & Book_Spoke & 
    
    if Chapter_Spoke<> "" then pagingurl = pagingurl & "&chapter_spoke=" & Chapter_Spoke & 
    
    if Verse_Spoke<> "" then pagingurl = pagingurl & "&verse_spoke=" & Verse_Spoke & 
    
    pagingurl = pagingurl & 
    text_data=yes&optAction=on"">"&i&"</a> "
    
    response.write pagingurl
    shows no errors but says "false".

  11. #11
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    dude, what are you doing to this stuff when you copy and paste??

    There are extra &'s being added to the code and that is what is cauing your problems. Also you are spliting lines all over the place. Not a good thing generally.

  12. #12
    Join Date
    Jul 2004
    Posts
    494
    I just noticed your previous posting. I used what you wrote and got :
    Microsoft VBScript compilation error '800a0409'

    Unterminated string constant

    /wheelofgod/kjvresp4.asp, line 265

    pagingurl = "<a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?page="&i&" & "&Keyword="& Keyword &"&Keywordb="& Keywordb &"&Keywordc="& Keywordc
    -------------------------------------------------------------------------------------------------------------------------------------------------------^
    With the arrow under the space that follows this: &"&Keywordc="& Keywordc

  13. #13
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    opps, I'll take the blame for that one, the line should be...
    Code:
    pagingurl = "<a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?page=" &i& "&Keyword="& Keyword &"&Keywordb="& Keywordb &"&Keywordc="& Keywordc

  14. #14
    Join Date
    Jul 2004
    Posts
    494
    No problem rokslide sometimes I don't realize when someone has posted until after I post again.

    Microsoft VBScript compilation error '800a03ea'

    Syntax error

    /wheelofgod/kjvresp4.asp, line 275

    pagingurl = pagingurl & "&text_data=yes" & "&optAction=on""">"&i&"</a> "
    -------------------------------------------------------------------^
    The arrow is on /

  15. #15
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    try this...
    Code:
    pagingurl = pagingurl & "&text_data=yes&optAction=on""">" & i & "</a> "

Posting Permissions

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