Using thescriptaculous framework, I toughed a problem that I can't
solve by myself. I try to send two variables from HTML code to the
server script. No problem to transfer the first variable ($query). For
the second variable ($media_only) I tried to use the option field. But
I do not succeed and need your advice which error I included.

Following the API Documentation and Reference: AJAX.AUTOCOMPLETER, I
tried the following:

HTML script:
<?php
...
    <form action="search.php" method="get">
        <table class="searchBox">
            <tr>
                <td>
                <input type="text" name="query" id="query" size="40"
value="<?php print($query);?>">
                </td>
                <td>
                <input type="hidden" name="search" value="1">
                <input type="submit" value="<?php print $sph_messages
['Search'];?>">
                </td>
            </tr>
            <tr>
                <td>
                <input type="checkbox" name="media_only"
id="media_only" value="1" <?php print $_REQUEST['media_only']
=='1'?'checked':''?>><?php print $sph_messages['mediaOnly']?>
                </td>
            </tr>
        </table>
        <div id="auto_suggest" class="suggest">
        </div>
        <script type="text/javascript">
          new Ajax.Autocompleter("query", "auto_suggest", "include/
suggest.php", {media_only: "media_only"});
        </script>
    </form>
...
?>

Server Script:
<?php
....
    $keyword = $_POST['query'];
    $media_only = $_POST['media_only'];
....
// here get the suggestions and send them to <div id="auto_suggest"
class="suggest">
...
?>

There is no problem to transfer $query and get the suggestions. But
unfortunately $media_only is not transferred to the server.

I would be very thankful if someone could advise me how to fix my
invalid code.

Thank you for your efforts


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to