Multiple autosuggest forms in same page

Pritam's Avatar

Pritam

05 Apr, 2012 04:33 PM

I am trying to work out two autosuggest text fields for a mobile application .
As given in the instructions I have given the two text boxes a sperate div and class tag
However my problem lies in appending the two search queries to the URL to make an ajax request to php
As far as I know $text = $_GET['q'] will retrieve only the first search query.
How do I get the second search query terms(It should work only if the first text box is filled out)
Please help me here,I am a jquery beginner and this is driving me CRAZY!!!

  1. 1 Posted by Jon on 11 Apr, 2012 06:41 AM

    Jon's Avatar

    This is what I've understood:

    -You have 2 autosuggest textboxes. You fill the first one and then you want to fill the second one filtering the options depending on the first autosuggest textbox.

    -You can try something like this:

    1-.Enable the first textbox and disable the second one.

    2-.Use 'selectionAdded' event to enable the second textbox when some element is added on the first one.

    3-.Use 'extraParams' parameter to add the data from the first textbox to the query of the second one. (ej: extraParams: '&textbox1='+$('#as-values-XXXXX').value();)

    4-.Use $text = $GET['q']; and $text2 = $GET['whatever_you_have_written_on_extraParams']; to retrieve both "textboxes".

  2. 2 Posted by ivan on 12 Apr, 2012 02:21 PM

    ivan's Avatar

    Hi Pritam i've the same problem with you, i try to create 2 textfiled on the same page (send message) which is to textbox and cc textbox, now im confuse how to separete the values between these 2 textbox
    Please help to

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac