SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Thread: HTML "arrays"

  1. #1
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)

    HTML "arrays"

    I'm trying to create a form that'll run a search on a phpBB forum. The problem is that they have a multiple select box to choose which forums you want to search in and I really don't feel like putting 20-ish hidden inputs on my search form to sepcify the forums. Is there a way I can do something like this?
    HTML Code:
    <input type="hidden" name="search_forums[]" value="1,2,3,4,5,6,7,8,9" />
    Thanks

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,220
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    why not use just the multiple select?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Because I automatically want it to search all forums and I want it to just be a textbox to type in search terms and the submit button. There is still a link to the main search page with all the option but I want just a simple one as well, like we've got at the top of these forums

  4. #4
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,220
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    okay, i guess i'm confused

    "The problem is that they have a multiple select box to choose which forums you want to search in"

    so, if you don't want the user to select which forums to search in, but rather, search in all forums, then why would you need hidden form fields?

    why not just search in all forums?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  5. #5
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    OK, you're confused

    Here is an example of the form I want to replicate. However, I want my version to just be a textbox and submit button. Easy enough, however I need to put all of those values from all of those options into my search form because the search script needs them to know what it's doing. Answer: hidden fields However I don't want the multiple select box to appear in my form but I still need the values specified somewhere, but 20-ish hidden fields to replace one select box doesn't seem like the best idea.

    Thus I though my above suggestion (although I doubt that'd work) was my preferred method. Is that clearer?

  6. #6
    Ceci n'est pas Zoef Zoef's Avatar
    Join Date
    Nov 2002
    Location
    Malta
    Posts
    1,111
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by DJ P@CkMaN
    Thus I though my above suggestion (although I doubt that'd work) was my preferred method
    I'm quite sure you're right.

    Rik
    English tea - Italian coffee - Maltese wine - Belgian beer - French Cognac

  7. #7
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,220
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by DJ P@CkMaN
    i get "Sorry but you are not permitted to use the search system."

    you didn't actually say this, but i'm guessing you are not in a position to alter the query that performs the search? and that it expects to receive a list of forum ids?

    because changing the query is the best solution
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  8. #8
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    I can, but I'd rather do it this way. It's just I'll be running alpha software and I don't want to make too many changes to the core code because when I update it I'll need to make the changes over again. I think I'll just use PHP to loop over the forums and output a hidden field. Less typing, dynamic and not changing the core code


Bookmarks

Posting Permissions

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