-
Posts
71 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by Akasha
-
-
Request.form
in ASP
I have found the problemMy first and second dropdown menu had the same nameso when he does the request form he will take the result from dropdown menu 1 and 2.
-
Request.form
in ASP
This is the outputrename=Rename itemhcat=testhoofdcategorie=Group, hoofdcategorieen=
-
Request.form
in ASP
forgot something
</tr><tr> <td><div align="left"></div></td> <td colspan="2"><div align="left"></div></td></tr><tr> <td class="p-content"><input name=rename type="submit" value="Rename item"></td> <td class="p-content"><div align="right"><input type='button' onclick="window.location.href='../main.asp'" name=submit value='Cancel'></div> </td></tr></form>
-
Request.form
in ASP
this is the code after the submit
If Request.Form("rename") = "Rename item" Then if Request.Form("hcat") <> "" then if Request.Form("hoofdcategorie") <> "" then sql ="UPDATE Hoofdcategorieen SET hoofdcat_name = '" &Request.Form("hcat")& "' WHERE (hoofdcat_name = '"&Request.Form("hoofdcategorie")&"')" Response.Write(Sql) end if conn2.Execute(sql)end if
and this is my form
<form name='form' method='post' action='change_menu.asp'> <tr> <td> <select name="hoofdcategorie" onchange="changeHoofdcat()"> <option value=''>--- Select a category --- <% 'Recordset set rs2 = Server.CreateObject("ADODB.recordset") rs2.Open "SELECT * FROM Hoofdcategorieen WHERE hoofdcat_id > 1 ORDER BY hoofdcat_name ASC", conn2 'Fill variables with values Do until rs2.EOF if Request("HoofdCat") = rs2.fields("hoofdcat_name") then Response.Write("<OPTION SELECTED value='" & rs2.fields("hoofdcat_name") & "'>" & rs2.fields("hoofdcat_name") & "</option>") else Response.Write("<OPTION value='" & rs2.fields("hoofdcat_name") & "'>" & rs2.fields("hoofdcat_name") & "</option>") end if rs2.movenext Loop rs2.close %> </select> </td> <% if Request("HoofdCat") <> "" then 'Recordset set rs2 = Server.CreateObject("ADODB.recordset") rs2.Open "SELECT c.*, h.hoofdcat_id FROM hoofdcategorieen h, categorieen c WHERE h.hoofdcat_name='"&Request("HoofdCat")&"' AND h.hoofdcat_id= c.hoofdcat_id ORDER BY c.cat_name ASC", conn2,1,1 'Fill variables with values Hoofdcat = Request("HoofdCat") if rs2.RecordCount = 0 then Response.Write("<td><INPUT TYPE=""text"" NAME=""hcat"" SIZE=""20"" MAXLENGTH=""30""></td></tr>") else if request("Cat") = "" then Response.Write("<td><INPUT TYPE=""text"" NAME=""hcat"" SIZE=""20"" MAXLENGTH=""30""></td></tr>") end if Response.Write("</tr><tr><td><select name=""hoofdcategorie"" onchange=""changeCat()""><option value=''>--- Select a category ---") Do until rs2.EOF if request("Cat") = rs2.fields("cat_name") then Response.Write("<OPTION SELECTED value='" & rs2.fields("cat_name") & "'>" & rs2.fields("cat_name") & "</option>") else Response.Write("<OPTION value='" & rs2.fields("cat_name") & "'>" & rs2.fields("cat_name") & "</option>") end if rs2.movenext Loop rs2.close Response.Write("</select></td>") end if end if %><% if Request("Cat") <> "" then 'Recordset set rs2 = Server.CreateObject("ADODB.recordset") rs2.Open "SELECT s.*, c.cat_id FROM categorieen c, subcategorieen s WHERE c.cat_name='"&Request("Cat")&"' AND c.cat_id= s.cat_id ORDER BY s.subcat_name ASC", conn2,1,1 'Fill variables with values if rs2.RecordCount = 0 then Response.Write("<td><INPUT TYPE=""text"" NAME=""categorie"" SIZE=""20"" MAXLENGTH=""30""></td></tr>") else if request("SubCat") = "" then Response.Write("<td><INPUT TYPE=""text"" NAME=""categorie"" SIZE=""20"" MAXLENGTH=""30""></td></tr>") end if Response.Write("</tr><tr><td><select name=""subcategorie"" onchange=""changeSubCat()""><option value=''>--- Select a category ---") Do until rs2.EOF if request("SubCat") = rs2.fields("subcat_name") then Response.Write("<OPTION SELECTED value='" & rs2.fields("subcat_name") & "'>" & rs2.fields("subcat_name") & "</option>") else Response.Write("<OPTION value='" & rs2.fields("subcat_name") & "'>" & rs2.fields("subcat_name") & "</option>") end if rs2.movenext Loop rs2.close Response.Write("</select></td>") if request("SubCat") <> "" then Response.Write("<td><INPUT TYPE=""text"" NAME=""scat"" SIZE=""20"" MAXLENGTH=""30""></td>") end ifend ifend if%>
-
Request.form
in ASP
HelloI have a button and when i push it, it must execute an sql update querythe query gets his information from a dropdown menu and a textfieldThat works all finebut somehow the &Request.Form("hoofdcategorie") functiongives back a strange result like
<option>,
for example i have choosen in my dropdown menu the item Groupthe query must be
UPDATE Hoofdcategorieen SET hoofdcat_name = 'test' WHERE (hoofdcat_name = 'Publications')
but instead he writes
UPDATE Hoofdcategorieen SET hoofdcat_name = 'test' WHERE (hoofdcat_name = 'Publications, ')
'Publications, 'the red part in the queryIs there sometime wrong with my Request.Form???thnxgreetzakasha
-
Already found a solution for that
-
Hmz.. ok now he fills my second dropdownbut loses the inserted value in dropdown menu 1is there a way to keep thos values ?
-
Hello peeps,i have this problem i can't figure out.I use ASP and have a formwith 2 dropdown menusthe first one gets filled with a querywhen someone makes a choice in the first dropdown menuthe second must contain the choices related to the first choice in dropdown menu 1Dropdown menu als needs to be filled with a query.what code needs in the function??or do you have another solution??
function changeHoofdcat(){ ?????}........<form name='form' method='post' action='links.asp'><select name="hoofdcategorie" onchange="go()"><option value=''>--- Select a category ---<% set rs2 = Server.CreateObject("ADODB.recordset") rs2.Open "SELECT * FROM Hoofdcategorieen WHERE hoofdcat_id > 1 ORDER BY hoofdcat_name ASC", conn2 'Fill variables with values Do until rs2.EOF Response.Write("<OPTION value='" & rs2.fields("hoofdcat_name") & "'>" & rs2.fields("hoofdcat_name") & "</option>") rs2.movenext Loop rs2.close%></select><br/><select name="categorie" onchange="go()"><option value=''>--- Select a category ---<% set rs2 = Server.CreateObject("ADODB.recordset") rs2.Open "SELECT c.*, h.hoofdcat_id FROM hoofdcategorieen h, categorieen c WHERE h.hoofdcat_name='"&SelValue&"' AND h.hoofdcat_id= c.hoofdcat_id ORDER BY c.cat_name ASC", conn2 'Fill variables with values Do until rs2.EOF Response.Write("<OPTION value='" & rs2.fields("hoofdcat_name") & "'>" & rs2.fields("hoofdcat_name") & "</option>") rs2.movenext Loop rs2.close%></select>
GreetzLeandra
-
-
RecordCount
in ASP
Already found the problem. :)Recordcount is not supported with the default forward-only cursor.so i opened it in a different waysolution is found at this link:http://www.aspfaq.com/show.asp?id=2193greets leandra
-
RecordCount
in ASP
Helloi am new with asp and i have a problemI want to check the number of records in a recordsetif there aren't any in it it must give back an error that there was nothing returnedif rs2.RecordCount > 0 thenthat all works fine except for one thing and that is dat rs2.RecordCount keeps giving back -1 even when the query didn't or did return something from the database?why do I get -1 :)I look at the explanation of recordcount but didn't get any wisergreets Leandraps. excuses for my english
uploading
in ASP
Posted
ok thnx it workedbut now i have the following problemI want to upload to another server (network connection)not to my own serveris there a possible way
then i get the error path doesn't exist