natasha23 Posted April 13, 2010 Report Share Posted April 13, 2010 hi i am currently trying to show the below values from a xml script using value typed in a text box. <user> <username>bob</username> <password>123</password></user> this is my asp script and at the moment the submit button isn't sending the value from the textbox to display both the username and password. This is my code below. <form method="POST" action="login.asp"><h1>Child nodes of root element catalog</h1><p>username: <input type="text" name= "username" id= "user" size="30" /> <input type="submit" name="submit" value="Submit"></td></p><%dim strPath, xmlFile, xmlRoot, TextValue, xmlItem, xmlNode, strText, teststrPath = Server.MapPath("staff.xml")Set xmlFile = Server.CreateObject("Microsoft.XMLDOM")xmlFile.Async = FalsexmlFile.Load(strPath)Set xmlRoot = xmlFile.DocumentElement Set xmlNode = xmlFile.DocumentElement.ChildNodesTextValue = Request.Form("username")test = Request.Form("submit")For Each xmlItem In xmlNodeif test > 1 ThenTextValue = xmlItem.TextstrText = xmlItem.TextelseResponse.write('<p>wrong</p>')End If%><P><% =strText %></p><% Next %></form> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now