<script type="text/javascript"> new Ajax.Autocompleter('FIELD','lista1','test.php',{minChars: 1, indicator: 'indicator1', frequency:0.6, afterUpdateElement: getSelectionId, callback:mycallback}); function getSelectionId(text, li) { document.getElementById('TEST').value = li.id; } function mycallback(obj,qs) { return qs+"&VAR1="+var1+"&VAR2="+var2+"&VAR3="+var3; } </script> Try this corrado
On 18 Nov, 13:56, "James Hoddinott" <[EMAIL PROTECTED]> wrote: > I'm stumped again :( I have the following HTML which is displayed > whenever a ticket is loaded: > > ... > <div id='respanel'></div> > <ul> > <li title='Changes made here will automatically start or stop the > clock as appropriate'>Service is <span id='istate'>Blocked</span></li> > </ul> > ... > > After that is loaded, the function loadIncidentAjax is called (via > onComplete): > > function loadIncidentAjax() { > //Elements within the incident > new Ajax.Updater('respanel','data/fetchrespanel.php',{method:'get'}); > new Ajax.InPlaceCollectionEditor('istate','data/updateticket.php',{ > collection:['Normal','Restored','Blocked','Barred'], > onComplete:updateAfterServiceChange > }); > ... > > } > > which updates the 'respanel' div and sets up the InPlaceCollectionEditor > for the user to choose an option. 'respanel' is a script which allows > the user to start/stop the clock running on the ticket (and initially > displays the appropriate button depending on the ticket's current state) > > The function updateAfterServiceChange is called after any change to > istate: > > function updateAfterServiceChange(val) { > var v = val; > new Ajax.Updater('respanel','data/fetchrespanel.php', { > parameters:'f='+v > }); > > } > > For testing purposes, fetchrespanel is setup to just print the post > value if the 'f' parameter is sent: > > if (isset($_POST['f'])) { > print "FOO = ".$_POST['f']; exit(); > > } > > What is stumping me is that this just produces "FOO = undefined" which > I just don't quite get. I tried altering the onComplete to > updateAfterServiceChange.defer() but that didn't seem to make any > difference. I'm figuring my problem lies within the > updateAfterServiceChange function? > > -- > James Hoddinott --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---