Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by Mixaalser684

  1. I understand perfectly what You are saying here, and that would be one approach, but You missinterpret what I meant when I said "refresshing an element".Let me expalin a little bit more.If I choose to leave the custom tags on the page, I tought, instead of returning an HTML and updating the element,I could manipulate the custom tag attribute object, which is responsible for filling the custom tag with results (an array list like object), and that change would be propagated in already rendered HTML element.The only problem I ran on here is after I manipulate the object I need to refresh the page in order to se the changesin the rendered HTML tag.Watch the video carefully and You'll see exactly what I mean. So this would be the second approach and my question is, is there a way to see these changes without manuallyrefreshing the page (if reloaded automatically with location.reload but it's not an elegant solution).The best solution would be if there was some function to reload rendered HTML element only and not the entire page?Is there such a thing in JavaScript or jQuery?Thank You.
  2. So the custom tags are off then.If the only way is to return the rendered HTML elements (and not custom tags) then I don't need them at all (in their current form).There was one more mechanism, I thought of, that could involve using the custom tags, but in order to use it successfully I need to figure out how to refresh HTML elements without re-submitting the page.Can someone please write a JavaScript code example?I've tried some searching online but no luck.Thank You.
  3. Of course, here is the video clip. Also, I have tried to create this element in Javascript callback function, but I'm getting DOM error no. 5.I know how to solve my problem (create a function that will hard code HTML elements as string) but I was wondering can this be solved via custom tags (if not then there is no need to use them, and they are really neat if you want to avoid code duplication).If You need some more information I'm at your disposal. Thank You.
  4. I have the need to have custom JSP tags in my web application.My custom tag works well when I run the application.Since I use Ajax (Javascript + Servlet + JSON) i tried to create my custom tag as a DIV element child in my Ajax Callback function.I tried using innetHTML method and createElement methods, and none of them works.So, I was wondering is this possible to do (or not) and how if it is?Thank You.
  5. Geeze, talking about case-sensitivity. This raises another question, how do I enable syntax checking for Javascript, in NetBeans IDE, to avoid stupid mistakes like this one in the future? Thanks a million. :)Cheers!
  6. Currently I'm learning Ajax with Java.The innerHTML method works when I'm retrieving simple string data from the servlet, and when I need to update only one HTML element.Since I have the need to update more HTML elements it occurred to me that I can use JSON object with several properties (HTML tag data for each element needed updating).After trying that I've noticed that innerHTML method doesn't work, when I try to process the retrieved data in the Callback function.My question is, why is this happening?Did someone had a similar problem when using JSON with Javascript.Just for the record, when I use innerText method I successfully update the HTML elements with JSON properties data, only they update as text and that's what I don't need. (See the video) Thank You.
  7. That was exactly what I did to try to solve al my problems. I've solved this one. Thanx
  8. I've put Javascript statements in the Forms OnChange event to trigger them when this event occurs. I wan't to know can I trigger VB Script Sub Procedures the same way with the Forms onChange event? For example I wan't to Filter a Recordset based on dropdowns list selection without submitting the form. Can this be done, without sending the request to the server?Thanx
  9. I have a database with three columns: intKorisnikID (Autonumber) - UserIDtxtIme (txt) - User NametxtPrezime (txt) - User Surname On the edit.asp page I'm passing the user ID via Request.QueryString("id"), and in the form on that page I want to b able to edit the name or surname of the selected user (from the index.asp page)Here is the edit.asp code: <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Admin - Edit</title></head><body><p><a href="index.asp">View Users</a></p><%Dim DBSet DB = Server.CreateObject("ADODB.Connection") DB.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("db/dbKorisnici.mdb")&";"Dim RSSet RS = Server.CreateObject("ADODB.Recordset")Dim SQLSQL = "SELECT * FROM tblKorisnici ORDER BY txtPrezime ASC;"RS.Open SQL, DB, 3, 3Dim updateSQLupdateSQL = "UPDATE tblKorisnici SET txtIme = '" & Request.Form("txtIme") & "' WHERE intKorisnikID = '" & Request.Form("txtID") & "' ;"DB.Execute updateSQL%><form action="edit.asp" method="post"><input name="txtID" type="hidden" value="<%= Request.QueryString("id") %>" /><input name="txtIme" type="text" value="<%=(RS.Fields.Item("txtIme").Value)%> "/><input name="txtPrezime" type="text" value="<%=(RS.Fields.Item("txtPrezime").Value)%>" /><input name="Submit" type="submit" value="Edit" /></form><%RS.CloseSet RS = NothingDB.CloseSet DB = Nothing%></body></html> On Line 29. which is DB.Execute updateSQL I'm getting Data type mismatch in criteria expression. I know it has something to do with the WHERE intKorisnikID = '" & Request.Form("txtID") & "' SQL clause, but I don't know how to make this work.If I put a number let say 14 instead of '" & Request.Form("txtID") & "' everything is working as it should the only problem is that I'm updating the same record (14th )each time.What do I need to put in order to be able to update the selected user (passed ID from the Request.QueryString("id")?Thanx.
  10. Mixaalser684

    ASP Hosts?

    I'm using free ASP and MS Access hosting on www.titanichost.com, but I don't know if it supports all that you want. Probably not because its free. There is no trial period on this host, not tha I know of.
  11. tblCardsintCardID (P.K. - Long Integer - Autonumber) txtCardName (Text 255)intQuantity (Long Integer)bitFoil (Yes/No)dblPrice (Double)memComment (Memo)intEditionID (Long Integer - Duplicates OK)intColorID (Long Integer - Duplicates OK)intConditionID (Long Integer - Duplicates OK)
  12. I'm not quite sure I understood the question.
  13. Look at this page Example.Now look at the part: Card instances 1 to 10 of 1853 (total quantity not included) You see the number 1853? That is not the total amount of cards I have in database. The total amout is around 3000. Now the database counts only how many times some card with the specific name appears in database but it doesn't count how much in quantity I have of each card that appears. The quantity number is represented with the "#" symbol. Now do I add the quantity for each specific card?
  14. Yes it works, thanx Justsomeguy Now I'll go and reupdate my dynamic application and If I have new trouble I'll call in. I hope I won't.
  15. I've removed this part from the code (in bold): input [b]<%If (CStr((rsContact.Fields.Item("bitChecked").Value)) = CStr("True")) Then Response.Write("checked=""checked""") : Response.Write("")%>[/b] type="checkbox" name="bitChecked<%=counter%>" id="bitChecked<%=counter%>"<input name="RecordID<%=counter%>" type="hidden" id="RecordID<%=counter%>" value="<%=(rsContact.Fields.Item("RecordID").Value)%>"></td> I've removed that part, and this part: cRecordID = "RecordID" & CStr(i)cbitChecked = "bitChecked" & CStr(i)'Create the update sql statementupdateSQL = "UPDATE tblContact SET bitChecked=" & fFormat(Request.Form(cbitChecked)) & " WHERE RecordID=" & fFormat(Request.Form(cRecordID)) Instead of cRecordID = "RecordID" & CStr(i)cbitChecked = "bitChecked" & CStr(i) I simply entered 'Create the update sql statementupdateSQL = "UPDATE tblContact SET bitChecked=" & fFormat(Request.Form( ""bitChecked" & CStr(i))) & " WHERE RecordID=" & fFormat(Request.Form("RecordID" & CStr(i))) And removed fFormat.When I ran the page and checked the first button and clicked submit I got this message: UPDATE tblContacts SET bitChecked=on WHERE RecordID=1UPDATE tblContacts SET bitChecked= WHERE RecordID=2Microsoft OLE DB Provider for ODBC Drivers error '80040e14'[Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement./allmymtgcards/update.asp, line 41 If I see well the page recognized the first entered value as on, and updated but when it got to the second button the button didn't had the default value because it wasn't clicked, so maybe I should ad somethin to take the values from the database and use them if they are not entered, but what?After that I tried checking all 3 checkboxes and submit and I got this error message: UPDATE tblContacts SET bitChecked=on WHERE RecordID=1UPDATE tblContacts SET bitChecked=on WHERE RecordID=2UPDATE tblContacts SET bitChecked=on WHERE RecordID=3Response object error 'ASP 0156 : 80004005'Header Error/allmymtgcards/update.asp, line 30The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content. Any explanations and Ideas?P.S. - Don't forget to check the original tutorial I'm using from my previous post.
  16. I'm sorry if posting links to other forums is forbidden, but you asked me if this is an example I got online. Yes and here's the link Update Multiple Records Tutorial.I'm trying to redo the original tutorial just for updateing the checkbox state, but even when I just copied and pasted this tutorial into DW I got an error message, so you can see why is it hard for me, because the examples I'm learning from are not 100% tested. I tried adding counter = 1 but the error message is the same. Other suggestions. Look at the original example.
  17. I tried changing name="checkbox<%=counter%>" and id="checkbox<%=counter%>" to name="bitChecked<%=counter&>" and id="bitChecked<%=counter%>" , and again its the error in update statement. Do I need to change the <%=counter%> part to something else? To what? Maybe Cstr (i)? but that's while loop it doesn't contain I?
  18. 'Create the update sql statement updateSQL = "UPDATE .... Response.Write(updateSQL & "<br>") Response.Flush The last UPDATE statement you see printed before the error is the one causing the problem.I added response.write and response.flush and I'm getting this: Can someone translate this to me? If I'm right I'm trying to update the field bitChecked with nothing right? If thats true where do I go from here?
  19. I've tried putting Response.Write(updateSQL), somewhere in my code but when I click Submit button, I don't see anything you suggested, just that error code. What am I doing wrong? I apologize JustSomeGuy, sorry, man it's not your fault I can't get this to work. Thanx anyway.
  20. Can't you see it form the code? The table i'm trying to update contains intColorID(zutonumber P.K.), txtColor(txt), bitColorChecked(Yes/No). The bitColorChecked field is the only important field I need to update. Any other suggestions?
  21. HOW CAN WE LEARN IF THE EXAMPLES WE ARE SUPOSE TO LEARN FROM THROW ERROR AT US!!!!!It would be alot more helpfull if you just wrote what was needed. After I read your "enlightening" answer I went on ADO Update W3 and tried for the hundredth time to figure why am I so stupid. I created the database, typed the code in DW only to see yet another error thrown at my face! So gentlemen next time when someone asks for you to write down an instruction for them If only thing you have to write is criticism on how we do not read enough don't write anything at all! Maybe some of us read something 3-4 times, tried that and for some (unknown) reason (to us) that sample code or wathever didn't work maybe thats why we are asking for help on forums. Bah, who am I writing this to I'll probably get spanked by some moderator for writing in caps. But I'm sick of people who are saying, "maybe you should read this a little more". To them I have to say, if you're tierd of unconditinaly helping people leave the forums.I appreciate your answers in the past Justoneguy but it would be alot more helpful if you explained to me the update statement instead of acusing me for not reading enough. Maybe I'm reading this for last three days, I've tried a hundred times and just can't get it to work, have you tought of that, huh?!
  22. Look at this code: <%@LANGUAGE="VBSCRIPT"%><!--#include file="Connections/connContacts.asp" --><%If Request.Form("action")="update" Then 'Set variables for update Dim updateSQL, i Dim cRecordID, cbitChecked 'Loop through records on screen and updateFor i = 1 To fFormat(Request.Form("counter"))'Create the proper field names to reference on the formcRecordID = "RecordID" & CStr(i)cbitChecked = "bitChecked" & CStr(i)'Create the update sql statementupdateSQL = "UPDATE tblContact SET bitChecked=" & fFormat(Request.Form(cbitChecked)) & " WHERE RecordID=" & fFormat(Request.Form(cRecordID))'Run the sql statementCall sRunSQL(updateSQL)Next'Refresh pageResponse.Redirect("update.asp")End IfFunction fFormat(vText) fFormat = Replace(vText, "'", "''")End FunctionSub sRunSQL(vSQL) set cExecute = Server.CreateObject("ADODB.Command") With cExecute .ActiveConnection = MM_connContacts_STRING .CommandText = vSQL .CommandType = 1 .CommandTimeout = 0 .Prepared = true .Execute() End WithEnd SubDim rsContactDim rsContact_cmdDim rsContact_numRowsSet rsContact_cmd = Server.CreateObject ("ADODB.Command")rsContact_cmd.ActiveConnection = MM_connContacts_STRINGrsContact_cmd.CommandText = "SELECT * FROM tblContacts" rsContact_cmd.Prepared = trueSet rsContact = rsContact_cmd.ExecutersContact_numRows = 0%><%Dim Repeat1__numRowsDim Repeat1__indexRepeat1__numRows = -1Repeat1__index = 0rsContact_numRows = rsContact_numRows + Repeat1__numRows%><form name="form1" method="post" action="update.asp"> <table> <tr> <td>Checked</td> </tr> <% Dim counterWhile ((Repeat1__numRows <> 0) AND (NOT rsContact.EOF)) counter = counter + 1%> <tr> <td><input <%If (CStr((rsContact.Fields.Item("bitChecked").Value)) = CStr("True")) Then Response.Write("checked=""checked""") : Response.Write("")%> type="checkbox" name="checkbox<%=counter%>" id="checkbox<%=counter%>"><input name="RecordID<%=counter%>" type="hidden" id="RecordID<%=counter%>" value="<%=(rsContact.Fields.Item("RecordID").Value)%>"></td> </tr> <% Repeat1__index=Repeat1__index+1 Repeat1__numRows=Repeat1__numRows-1 rsContact.MoveNext()Wend%> </table> <input name="action" type="hidden" value="update"> <input name="counter" type="hidden" value="<%=counter%>"> <input type="submit" value="update"></form><%rsContact.Close()Set rsContact = Nothing%> I'm getting this error: Line 39 is this: And this is the procedure this line belongs to:Sub sRunSQL(vSQL) set cExecute = Server.CreateObject("ADODB.Command") With cExecute .ActiveConnection = MM_connContacts_STRING .CommandText = vSQL .CommandType = 1 .CommandTimeout = 0 .Prepared = true [b].Execute()[/b] End WithEnd Sub Why is there a problem and how do I fix it? Thnx.
  23. The error message was form the first longer example. The one I've posted was shorter with only one table involved.Here's the second (alos short example with one table) with the same error message problem:<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%><%set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "h:/inetpub/wwwroot/db/allmymtgcards.mdb"%><%Dim MM_editActionMM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))If (Request.QueryString <> "") Then MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)End If' boolean to abort record editDim MM_abortEditMM_abortEdit = false%><%' IIf implementationFunction MM_IIf(condition, ifTrue, ifFalse) If condition = "" Then MM_IIf = ifFalse Else MM_IIf = ifTrue End IfEnd Function%><%If (CStr(Request("MM_update")) = "form1") Then If (Not MM_abortEdit) Then ' execute the update Dim MM_editCmd Set MM_editCmd = Server.CreateObject ("ADODB.Command") MM_editCmd.ActiveConnection = conn MM_editCmd.CommandText = "UPDATE tblColor SET bitColorChecked = ? WHERE intColorID = ?" MM_editCmd.Prepared = true MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 5, 1, -1, MM_IIF(Request.Form("bitColorChecked"), 1, 0)) ' adDouble MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 5, 1, -1, MM_IIF(Request.Form("MM_recordId"), Request.Form("MM_recordId"), null)) ' adDouble MM_editCmd.Execute MM_editCmd.ActiveConnection.Close ' append the query string to the redirect URL Dim MM_editRedirectUrl MM_editRedirectUrl = "dfault.asp" If (Request.QueryString <> "") Then If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString Else MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString End If End If Response.Redirect(MM_editRedirectUrl) End IfEnd If%><%Dim rsDim rs_cmdDim rs_numRowsSet rs_cmd = Server.CreateObject ("ADODB.Command")rs_cmd.ActiveConnection = connrs_cmd.CommandText = "SELECT * FROM tblColor" rs_cmd.Prepared = trueSet rs = rs_cmd.Executers_numRows = 0%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Untitled Document</title></head><body><form method="post" name="form1" id="form1"><%while rs.EOF=false%><p><input <%If (CStr(rs.Fields.Item("bitColorChecked").Value) = CStr("True")) Then Response.Write("checked=""checked""") : Response.Write("")%> name="bitColorChecked" type="checkbox" value="" /><%response.write(rs.fields.item("txtColor").value) rs.MoveNext%></p> <%wend%><input name="Submit" type="submit" value="Submit" /></form></body></html><%rs.closeconn.closeset rs = Nothingset conn = Nothing%> And the error is the same (showing the right line this time): I understand what the error says but I don't know why it says that because there are 10 records in rs.Color (so it's obviously not empty). Here's what I've noticed that may be of any help. If I put the repeat region(while-wend) around the form, there are no error messages but I don't want to do it that way. I wan't to create the region inside the form, so that the amount of checkboxes for each record is repeated, but still only one submit button is left so when I submit the form it all the records are updated(states of checkboxes). That should be the example above, but it gives this error message. Can someone explain why and rewrite the code and post it and make this work? Thank you.
  24. Anyone guys? I'm waiting for 3 days. Please.
  • Create New...