My problem is that I create a form based on how many channels they
want to add.  So if they select 30 channels then the form will have 30
text boxes that need autocomplete to work.  I had this working for a
while and can't remember any code that I have changed, it just seemed
to stop working.  I have updated to latest and greatest scriptaculous
and still not working.  It will work for the first text box always,
just never any of the other ones.  Here is my code, I have stripped
out meaningless stuff in the PHP that is unrelated.

This is callsign_search.php:

<?
        require_once ('./includes/mysql_connect.php'); //connect to the
databse

        $query = "SELECT Call_Sign, FullName FROM gn_stage.stg_stations WHERE
Call_Sign LIKE '" . $_POST['name'] . "%' ORDER BY Call_Sign ASC LIMIT
10";
        $result = @mysql_query ($query); //run the query on the db
?>

<ul>
<? while($data = mysql_fetch_assoc($result)) { ?>
  <li class="hint"><? echo stripslashes($data['Call_Sign']);?><span
class="informal">&nbsp;&mdash;&nbsp;<? echo
stripslashes($data['FullName']);?></span></li>
<? } ?>
</ul>


This is addchan.php:

<?
        echo '<p><form action="?" method="post">
                <table valign="top" align="left" cellspacing="0" 
cellpadding="5">
                <tr>
                <td align="left" width="50"><b>Add:</b></td>
                <td align="left" width="100"><b>Channel #:</b></td>
                <td align="left" width="150"><b>Call Sign:</b></td>
                <input type="hidden" name="hlp_hed_key" value="'.$h.'">
                </tr>';

        for ($i=0,$k=2;$k<=$c;$i++,$k++) {
        echo '<tr class="records"><td align="left"><input type="checkbox"
class="form" name="addch[]" value="'.$i.'" checked></td>
        <td align="left"><input type="text" class="form"
name="hlp_chan_num[]" size="5" value="'.$k.'"></td>
        <td align="left"><input type="text" class="form" id="hlp_callsign"
name="hlp_callsign[]" size="12" value="">
        <div id="hint"></div>
        <script type="text/javascript">
                new 
Ajax.Autocompleter("hlp_callsign","hint","callsign_search.php",
{paramName:"name"});
        </script></td>
        </tr>';
        }

        echo '<tr><td align="left" colspan="3"><p>
        <input type="submit" id="submit" name="add" value="Add Channels"></
p></td></tr></table></form></p>';
?>

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to