utilizzando questo script, selezionando dall campo la descrizione di un cliente, come posso far popolare il campo indirizzo con l'indirizzo corrispondente al cliente selezionato?
Graziecodice:<script> jQuery.noConflict(); jQuery(function() { jQuery.widget( "app.autocomplete",jQuery.ui.autocomplete, { // Which class get's applied to matched text in the menu items. options: { highlightClass: "ui-state-highlight" }, _renderItem: function( ul, item ) { // Replace the matched text with a custom span. This // span uses the class found in the "highlightClass" option. var re = new RegExp( "(" + this.term + ")", "gi" ), cls = this.options.highlightClass, template = "<span class='" + cls + "'>$1</span>", label = item.value.replace( re, template ), $li = jQuery( "<li/>" ).appendTo( ul ); // Create and return the custom menu item content. jQuery( "<a/>" ).attr( "href", "#" ) .html( label ) .appendTo( $li ); return $li; } }); var availableTags = [ <% Set objConn=Server.CreateObject("ADODB.Connection") objConn.Open "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=10.10.10.10;DATABASE=log;UID=IO;PASSWORD=IO" Set objRs1 = Server.CreateObject("ADODB.Recordset") strSQL1="SELECT DISTINCT Descrizione, Indirizzo FROM Clienti WHERE Tipo = 'F'" objRs1.CursorType = 3 objRs1.CursorLocation = 3 objRs1.LockType = 3 objRs1.Open strSQL1, objConn While objRs1.EOF = False if objrs1("Descrizione") <>"" then Descrizione=Descrizione&""""&objrs1("Descrizione")&"""," objRs1.Movenext Wend objRs1.close set objRs1 = Nothing response.Write(left(Descrizione,len(Descrizione)-1)) %> ]; jQuery( "#tags" ).autocomplete({ minLength: 1, highlightClass: "bold-text", source: availableTags }); }); </script> <input type="text" name="Descrizione" id="tags" size="76" > <input type="text" name="Indirizzo" id="indirizzo" size="76" >

Rispondi quotando