Jump to content

help with asp script


natasha23

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...