Jump to content

holsy

Members
  • Content Count

    27
  • Joined

  • Last visited

Community Reputation

1 Neutral

About holsy

  • Rank
    Newbie
  1. holsy

    Parse XML files?

    Sorry, posted twice by accident.
  2. holsy

    Parse XML files?

    Can anyone give me some pointers on how to parse xml files using asp? I have tried numerous examples searching google but can't get it to work. I have not performed an xml read before. Here is the xml file structure (note: this xml file has no root element). <?xml version="1.0" encoding="utf-8"?><item><supplier_id>2006</supplier_id><drop_ship_fee>3.00</drop_ship_fee><supplier_name>Beethoven</supplier_name><product_id>4185456</product_id><product_sku>340</product_sku><item_last_update>2011-12-31 15:07:39.0</item_l
  3. Just tried it...and it works! javascript is not my forte. Thanks JamesB
  4. Hi There, Does anyone know what I am doing wrong in trying to pass a variable to use as a parameter. //Form Validationfunction validate(form) {var e = form.elements, m = '';if(!e['txtUserName'].value) {m += 'Username is required<br/>';}var xhReq = new XMLHttpRequest();var username = e['txtUserName'].value//alert(username);xhReq.open("GET", "checkusername.asp?username=\'' + username + '\'",false);xhReq.send(null);var serverResponse = xhReq.responseText;alert(serverResponse);if(!e['txtPassword1'].value) {m += 'Password is required<br/>';}if(!e['txtPassword2'].value) {m += 'Repeat P
  5. thanks justsomeguy for pointing me in the right direction. I have finally got the synchronous ajax request to work! cheers!
  6. justsomeguy, Took your advice about sending an ajax request. From what I've read, it is the best way to go about this. I am trying something like this: //Form Validationfunction validate(form) {var e = form.elements, m = '';if(!e['txtUserName'].value) {m += 'Username is required<br/>';}var xhReq = new XMLHttpRequest();var strusername = e['txtUserName'].valuexhReq.open("GET", "checkusername.asp?username=\'' + strusername + '\'",false);xhReq.send(null);var serverResponse = xhReq.responseText;alert(serverResponse);if(!e['txtPassword1'].value) {m += 'Password is required<br/>';}if(!e
  7. I am pretty weak with my Ajax or javascript coding coming from a vbscript background however I did come up with an ugly solution that will allow me to continue with asp and should work for now cause I am staring at a deadline. 'Form Validation Response.Write "<script type=""text/javascript"">" & _ "function validate(form) {var e = form.elements, m = '';" & _ "if(!e['txtUserName'].value) {m += 'Username is required<br/>';}" 'ASP CODE HERE Dim objRS, strtemp, strUserName, strPassword, strEmail, strPlan, strResponse strUserName = trim(Request.form("txtUserName")) Set ob
  8. Hi All, I am unable to do a check for duplicate records before the form is submitted to Paypal. Here is the form: <form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post" onSubmit="return validate(this);"><input name="txtUserName" id="txtUserName" type="Text" tabindex="1" /><input name="txtPassword1" type="password" tabindex="2" /><input name="txtPassword2" type="password" tabindex="3" /><input name="txtEmail" type="Text" tabindex="4" /></form> I am doing javascript client side validation with this block of code: //Form Validation
  9. Finally solved it with suggestion from justsomeguy: selCrit = "OR" strInput = Request.form("searchbox") arrSearch = split(strInput, " ") strSQL = "SELECT * FROM videos WHERE" strCombine = join(arrSearch, "%') " & selCrit & " (tags LIKE '%") strSQL = strSQL & " (tags LIKE '%" & strCombine & "%')" Thanks for the suggestion. My headache is gone now
  10. How about something like this OR statement? Dim ListArray sqlCriteria = trim(Request.QueryString("searchbox")) ListArray = split(sqlCriteria, " ") For loopctr = 0 to Ubound(ListArray) NewItem = "tags='" & ListArray(loopctr) & "'" response.Write NewItem response.write "<br>" If Len(SqlCriteria) > 0 Then JoinStatement = " OR " Else JoinStatement = "" End if MySqlCriteria = MySqlCriteria & JoinStatement & NewItem Next sSQL = "Select * From videos Where " & MySqlCriteria response.Write sSQL I found this online but it is currently
  11. Hi All, I have a multiple word function that I am having trouble getting the SQL IN statement to return any records. I want to return records containing ANY of the search query words. Here is the code: Dim thisArray, i, sqlCriteria sqlCriteria = trim(Request.QueryString("searchbox")) thisArray = split(sqlCriteria, " ") sSQL = "SELECT * FROM videos WHERE tags IN ('" & Join(thisArray, "','") & "')" The sqlCriteria = trim(Request.QueryString("searchbox")) is receiving the url parameter string of: ?searchbox=socks+white+cottonThe words are seperated with a "+" sign. Somehow, the
  12. Installed tamper addon for Firefox and viewed the outgoing data. The "content" did show an encoded string outgoing and I tried using the Form("content").Value and Form("content") to read the form item. Still nothing however the javascript alert box did show the value: onSubmit:function submitData(content){alert(content.current)}, Just can't my asp script to read the content. Hmmm..still stumped but really appreciate the help and responses justsomeguy. May just leave it for now and may get an a-ha moment.
  13. The current form includes an upload component and is type ENCTYPE="multipart/form-data". All processing is done on the same page as well; the code detects a form post and processes uploads, text box entries, etc. Everything is working fine. I am able to get ipweditor to work client side but have no idea how to read the values from Ipweditor. Using ASP Pure Upload, I am using Form("textboxvalue").Value instead of Request.Form. With ipweditor, I have tried Form("content").value, Form("content.current").value, and other ways of trying to get the value without any luck. Javascript is not my strong
  14. I'm using an upload component for file uploads.
  15. So, I can remove: $.ajax({ type: "POST",url: "save.php", data: {"content": content.current}, complete: function(){ }, //manage the complate if needed success: function(html){ }//get some data back to the screen if needed However, I am still unable to make the correct call to retrieve the values on the retrieving page. The php example is of little use to me. I am currently retrieving values via ENCTYPE="multipart/form-data" with Pure Asp Upload (ex."Form("form-component").Value"); I have tried Form("content").Value using asp but cannot retrieve a value. Any ideas how to retrie
×
×
  • Create New...