Link to home
Start Free TrialLog in
Avatar of newbie27
newbie27Flag for United Kingdom of Great Britain and Northern Ireland

asked on

ajax response assign to the text fields

Hello Experts,
I am using these function to do ajax request to the builder.asp which originally has returned comma separated list ids,
I now want to return 2 more information ie: name and notes from the showListRefs function and assign it to the corresponding text fields.
Please can you help
Thanks
Sam
Avatar of newbie27
newbie27
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER


javascript function
----------------------
function getListRefs(sListname)
{
	$.ajax({
	  type: "POST",
	  url: "list_builder.asp",
	  data: "action=results&listname="+sListname,
	  success: function(msg)
	  		{					
				$("#listRefnos").val( msg );		
	
				var sRefNumbers = $("#listRefnos").val();
				var sViewQuery = "SF1=keyword&ST1="+sRefNumbers;     
				//alert("sViewQuery: "+sViewQuery);
				
				listViewer("#listDisplay1",sViewQuery);
				
                                $("#txtListName").val('test6');     //  I want to assign the name here
				$("#txtNotes").val('test notes');   //  and notes here
			}
	 
	});
} 
 
 
ASP function
-------------
 
 
 
PRIVATE FUNCTION showListRefs(sListName)
    sFilename = "test@test.com.xml"      	
    sXMLFile = ADMIN_WWW_FOLDER & "\lists\data\" & sFilename            
    Set objXML = Server.CreateObject("Microsoft.XMLDOM")
 
	If objXML.load(sXMLFile) Then
		Set objRoot = objXML.documentElement
    End if
 
    Set oNodes = objXML.selectNodes("//lists/*")
   
	count = 1
	For Each oChild In oNodes
	 
		if oChild.childNodes(0).text = sListName Then
		   	showListRefs = oChild.childNodes(2).text    '   this will give us comma separeted IDs
                       
                        'showListRefs =   oChild.childNodes(1).text   ' this will give the list name	 
                        'showListRefs =   oChild.childNodes(0).text   ' this will give the list notes
			
		End if
	Next 
	showListRefs = showListRefs 
 
END Function

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks