We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33992 ☆ A M B ☆
    • 455 Posts
    Hi;
    Finally i could solve my problems with Ajax Search(;D) and now i have a question about result links,
    I use Ajax Search 1.6 like below:
    main template codes
    ........
    
                                      <div>
                                               <frame>
                                                              search box and results
                                               </frame>
                                      </div>
    </body></html>

    when a result link is clicked, new page appears in the frame,
    is it possible to open links in main page(which includes search box) like usual links opening?
    OR in a new window(using target)?


    Thanks
    AHHP
      God loves me. 【ツ】


      MODX.ir (Persian Support)

      Boplo.ir/modx/ (Persian)
      • 25307
      • 114 Posts
      I’m looking for the best way to approach integrating a web user search..

      Could it be possible to use/modify this snippet to either of these things:

      1-Search specific MySQL tables? (example: search the web_user_attributes table)
      ..or..
      2-Show results from within the a page as separate items (example: shows each list item on the page being searched as a separate result)

      any help greatly apprectiated.
        • 33992 ☆ A M B ☆
        • 455 Posts
        [sorry robot],
        I found the solution of my problem with ajax search, i have a link in my template that use JS files(prototype or scriptaculous):
        <a id="closebutton" onclick="Effect.toggle('searchcontainer','Appear'|'BlindDown','duration:3.0')">search</a>

        if i use ajax search in page (use mootools.js) the link and search won’t work and i must remove one of them, so i must either remove search or link from pages to using one of them well.
        in the other words mootools.js is not compatible with prototype.js or scriptaculous.js and this problem forced me call AjaxSearch in a frame to use both.
        so i must select one of them to use,
        OR
        use ajaxsearch in external page like frames that causes this problem(two post later) for me,
        OR
        find a solution for compatible problem.
        please help me to use them well wink

        Thanks
        AHHP
          God loves me. 【ツ】


          MODX.ir (Persian Support)

          Boplo.ir/modx/ (Persian)
          • 27708 MODX Staff
          • 2,502 Posts
          Bugfix Request

          Kyle,

          Could you please mod the /assets/snippets/AjaxSearch/includes/template.inc.php so that the <input> elements are not nested in the <label> elements. This is not valid markup in any strict Doctype. This therefore is a bug.

          //Form Template
          	'form' => '
          		<form [+as.formId+]action="[+as.formAction+]" method="post">
          			<label for="ajaxSearch_input">
          				<input id="ajaxSearch_input" type="text" name="search" value="[+as.inputValue+]"[+as.inputOptions+] />
          			</label>
          			<label for="ajaxSearch_submit">
          				<input id="ajaxSearch_submit" type="submit" name="sub" value="[+as.submitText+]" />
          			</label>
          		</form>',
          		

          Should be as follows:
          //Form Template
          	'form' => '
          		<form [+as.formId+]action="[+as.formAction+]" method="post">
          			<label for="ajaxSearch_input">Search</label>
          				<input id="ajaxSearch_input" type="text" name="search" value="[+as.inputValue+]"[+as.inputOptions+] />
          			
          			<label for="ajaxSearch_submit"> </label>
          				<input id="ajaxSearch_submit" type="submit" name="sub" value="[+as.submitText+]" />
          			
          		</form>',
          		


          This will solve other people’s constant problem with validation.

          Thanks for such a great snippet though!

          Jay
            Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
            • 25663 MODX Staff
            • 12,272 Posts
            Jay, I think you’re a bit confused on the validation. Inputs nested in their corresponding labels are completely valid. Both elements are inline elements, and inline elements can always be nested. Nesting block elements in inline elements however is invalid (e.g., a P in a SPAN).

            Here’s a quick test for you to check yourself: http://modxcms.com/formtest.html (Validates XHTML 1.0 Strict)

            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
                "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
            
            <html>
            <head>
                <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
                <title>Form Test</title>
                
            </head>
            <body>
            <form action="#" method="get" accept-charset="utf-8">
                <fieldset>
                    <label for="inputtest"><input type="text" id="inputtest" value="Continue →" /></label>
                    <label for="submittest"><input type="submit" id="submittest" value="Continue →" /></label>
                </fieldset>
            </form>
            </body>
            </html>
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
              • 27708 MODX Staff
              • 2,502 Posts
              Ryan,
              I have reread the spec and agree. Don’t like to be wrong but like to learn new things. Thanks for calling me on my error.

              All the best,

              Jay
                Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
                • 25663 MODX Staff
                • 12,272 Posts
                Oh man you are a bigger man than I am for reading the spec, which is fraught with ambiguously and awkwardly worded things! John Gallant (world’s greatest CSS bug documenter from positioniseverything.net) and I have spent hours at a time on more than one occasion trying to figure out what some obscure part of the spec means, and whether Fx, Saf or IE is getting it right. The spec in fact may state that the labels can’t nest inputs, but Standardistas will moan if they don’t pass the online validator from the w3c ... so sadly I code to the validator myself. tongue
                  Ryan Thrash, MODX Co-Founder
                  Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                  • 27708 MODX Staff
                  • 2,502 Posts
                  Ryan,

                  Just to point out for clarification: When a label wraps or nests an input it is the same as using the "for" attribute. This is what the W3C calls implied labeling vs. implicit labeling (which is using the "for" attrib.) So it is completely fine to nest inputs and it is completely fine to omit the label value as the user agent is supposed to use the "name" attribute of the input as the label.
                    Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
                    • 25663 MODX Staff
                    • 12,272 Posts
                    Very good info on wrapped inputs I definitely wasn’t aware of ... thanks for sharing. smiley
                      Ryan Thrash, MODX Co-Founder
                      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                      • 2912
                      • 315 Posts
                      I’m having trouble with multiple word searches. I can search for one word and get a very nice page. I try two or more words (with highlighting) and the results start to show HTML code from introtext and content text. I’ve been removing image descriptions and titles but I would prefer to keep them in.

                      Is there a way to get it to render the right result or do I need to remove search hightlighting?

                      Thanks,

                      UPDATE: I’ve tried to stop Search highlighting but disabling the plugin hasn’t gotten anywhere.

                        BBloke

                      This discussion is closed to further replies. Keep calm and carry on.