Jump to content

kastellu

Members
  • Posts

    39
  • Joined

  • Last visited

kastellu's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. So nobady doesn't know how to read a value of select list or drop down box?K
  2. Hello,Firstly, thanks for your replay. No that is not it! I am working in some report software, that is java coded. All objects are just drag and drop, with that i mean that you only grag a selectbox in to report and set some properties, and it works. But the only way you can customize your reports is with some HTML item , where you can write in a javascript that can corespond to that report.. The problem is that i get the values in to some selectbox (i get only need value that is prefiltered from some other object) , but since i wouldn't like to see the result in a selectbox i would like to hide that selectbox(visibility it is a propertie of this object) object and its value send to text item or tag if you like it (that tag has a object name as well). So what i am trying to do is to put that HTML object where that script would be written - select value from hidden selectbox(SELECTBOXVALUE - name) and writte it into tag object (TAGEVALUE-name) - this is only a regular tag in main page and not pop up.I hope you understand. The report software is COGNOS BI 8.2Thanks for your help!Best regards,K
  3. Hello,I don't have any clue about javascript , so that is why i am asking you about this. How to writte a script that will give me a value from listbox and it would be pasted into text item or just be a text. So ,,... , value BIKE from a listbox (name of object is LISTBOX1) as an object to ,....,BIKE in a text ite (name of a text item is TEXTITEM2).Can you please give me a full script.Thank youK
  4. Hello,At bottom you can see the code of SQL procedure that inserts the value to a table1. And the test asp page which has a form with where the value is insertet and submited. The problem is that i don t know how to send the value to an executed procedure , that is wrong and that is the reason why i get an error that the parameter for procedure is not provided. I know that i need to provide the Web value from a form at the time that the procedure is executed. Can you help me with this problem. The procedure in SQL works but when a button is submited the error ...Thanks,KASP test page <form name = "test" action = "test.asp?sub=add" method = "POST"><input type = "text" name = "ValueWEB"><input type = "submit" name ="insert" value = "enter"></form><%ValueWEB = RequestForm("ValueWEB")set cnn = server.createobject("ADODB.Connection")cnn.open "PROVIDER = SQLOLEDB; DATA SOURCE = TESTSERVER; UID = sa; PWD = test123; DATABASE =db"If ValueWEB <> "" thencnn.testprocedureend if%> testprocedure in SQL SERVER 2005 USE dbGOCREATE PROCEDURE testprocedure( @ValueWEB varchar(30))ASINSERT INTO ValueTable( Value)VALUES( @ValueWEB)
  5. Firstly i would read some tutorials and try some examples , how to write in to DB and how to read from DB, that are on w3schools , secondly i would work with simple web page that has funcionalities of updating the data from DB. I would recomend that you go trought few examples and trough tutorials so that you will understand what is all about ( conn , if , case , sql statement, cn.close, update,...)
  6. O.K. thanks !But here is another problem, how to put value , back to first one, when you click on it again!thanks
  7. Hello, Could someone help me with this one. I would like to change the order by when clicking on link.My code: <a herf = "index.asp?sort=asc">Products<%sort = request.querystring ("sort")If sort = asc then SORTBY = ascElseSORTBY = descsql ="SELECT * FROM tblExample ORDER BY '& SORTBY &';"%> Am i on a right way or did i lose it fully.Thank you
  8. Hello,How can you create a loop that will after a limited nuber of row or exported data create a new page and loop on , and again create new page,....So if you have 1000 row, i would like to limit this on to subpages to ever hundred or less rows per page. I don t eaven know is there other function in asp that creates that,..Thank you an example woul be welcome.L
  9. Hello,Let me first try to explain you what i am trying to do! I have created an page default.asp where a loop on vaules from db is made and i get a list of data.HOMESUPPORTSOFTWAREHARDWARENow i have made an querystring , so if i chose one of the values , for example SOFTWARE i will get next page:HOMESUPPORTSOFTWAREHARDWAREWindowsXPWindows2000Windows98Windows95How do i get this data. When i chose a SOFTWARE the querystring takes an value and starts if sentence If Request.QueryString (VALUE) ="Software"<!--#include file="softwarelist.asp"-->End IF... O.K. the problem comes now in softwarelist where:WindowsXPWindows2000Windows98Windows95is i have another querystring so that if i click for example WindowsXPI will get sub content(zip,rar,iso,..) . If i run software list by itself works fine, but if i run it unde default.asp i will get with get with screen only with fist values of SOFTWARE, HARDWARE,...I know that the problem is in querystringdefault.asp?value=Software works , but when you call sub querystring t he problem comes because i lose default.asp?value=Software and is changed into whatever the href of the querystring in software.asp is What i would like to see but i cant is:HOMESUPPORTSOFTWAREHARDWAREWindowsXPWindows2000Windows98Windows95ziprarisoSo how to do the querystring or set the href of every sub querystring that the data of previous and this one would be still there and i could open all sub "data" - some kind of menu , submenu , subsubmenu,...Thank you for hel i hope u understand
  10. HelloThanks for that! But a few minutes ago i just did it like this.Value = 0 Then Value ""If Value <> "" Then Run = 1...Select Case RunCase 1SQL = SELECT * FROM tblCompany WHERE Cost = " & Value & " ;"By using <> i can writte all the combinations that i want ,...Thanks
  11. Hello , let mi first try to show you what i am trying to do. date1 = Request.Form("date1")date2 = Request.Form("date2")date = Request.Form("date")value1 = Request.Form("value1")value2 = Request.Form("value2")company = Request.Form("company")If date ="" and value1 = "" and value2 = "" and company = "" and date2="" and date1 ="" Then checking = 1 End IfIf date ="1" and value1 = "" and value2 = "" and company = "" and date1 ="" And date2="" Then checking = 3 End IfIf date ="2" and value1 = "" and value2 = "" and company = "" and date1 ="" And date2="" Then checking = 4 End IfIf date ="3" and value1 = "" and value2 = "" and company = "" and date1 ="" And date2="" Then checking = 5 End IfIf date = "4" and value1 = "" and value2 = "" and company = "" and date1 ="" And date2="" Then checking = 6 End IfIf value1 = "" and value2 = "" and date1 ="" And date2="" Then checking = 7 End IfIf company = "" and value2 = "" and date1 ="" And date2="" Then checking = 8 End IfIf value1 = "" and company = "" and date1 ="" And date2="" Then checking = 9 End IfIf value2 = "" and value1 = "" and company = "" And date2="" Then checking = 10 End IfIf date1="" and value2 = "" and value1 = "" and company = "" Then checking = 11 End If...'as you can see i am trying to write all the combinations to make a search without an error. But i have a problem with writting this if statementSelect Case checking Case 1 sql = "SELECT * FROM tblcompany;" Case 2 sql = "SELECT * FROM tblcompany WHERE company_date BETWEEN "&(date1)&" AND " &(date2)&";" Case 3 sql = "SELECT * FROM tblcompany WHERE company_date BETWEEN "&fncleto(a)&" AND "&fncdanes(b)&" ;" Case 4 sql = "SELECT * FROM tblcompany WHERE company_date BETWEEN "&fncmesec(c)&" AND "&fncdanes(b)&";" Case 5 sql = "SELECT * FROM tblcompany WHERE company_date BETWEEN "&fncteden(d)&" AND "&fncdanes(b)&";" Case 6 sql = "SELECT * FROM tblcompany WHERE company_date = "&fncdanes(b)&" ;" Case 7 sql = "SELECT * FROM tblcompany WHERE company = " &company&";" Case 8 sql = "SELECT * FROM tblcompany WHERE company_value >= " &value1&";" Case 9 sql = "SELECT * FROM tblcompany WHERE company_value <= " &value2& ";" Case 10 sql = "SELECT * FROM tblcompany WHERE company_date >= "&date1&";" Case 11 sql = "SELECT * FROM tblcompany WHERE company_date <= "&date2&";" Case 12 sql = "SELECT tblcompany.company, tblcompany.company_value FROM tblcompany WHERE (((tblcompany.company)='" & company & "') AND ((tblcompany.company_value)='" & value1 & "'));" ... End Select O.K. I have a problem with writting a corect If statement, ... Why this kind of statement, i would like to writte all of the combinations of atributs so that i would never get an eror and allways an corect SELECT would be made. For example: when nothing is chouse i get he table with all the data , and so on. I eaven would like to filtet with more combinations. This will be a filter for data that i get from the DB. date is an radiobutton,... i think that you will figer it out, but this still aren t all the combinations that i wrot , this is just a part of it,...Can someon help me with this IF statementThanks
  12. kastellu

    Table

    Hello,Anyone has an colum sortable table code. I have created conection to DB an i get data in a table. But now i would like to install some JAVASCRIPT with more advance filtering by rows , sum , sorting by rows and limitation of number of rows per page. I am working with ASP. If not mabe just a code for limitation of number of rows per page with next an prewious link to go trought data. And code for sum one of the coloum with footer row where the sum is.The best would be one advanced javascript for tables. I only found the basic one. I dont have a clue about scripting in this language, so please , help me.Regards
  13. kastellu

    checkbox

    Thanks it works!
  14. kastellu

    checkbox

    Hello,Can someone help me with this code , i tried to create an filter that if a check box is checked the select case would test one sql select and if not would do the other one. I was checking what i get (response.write sqlresponse.end ) , the only result that i get was when if ch1 = "" was like this ufcourse the forum is not written in full version. What am i doing wrong , mabe someone can repair my code. Thank you response.write("<tr><td><input type='checkbox' name='ch1'></td></tr>")ch1 = Request.Form("ch1")If ch1 ="1" then test= 1 else test = 2 end ifSelect Case test Case 1 sql = "SELECT * FROM tblxx;" Case 2 sql = "SELECT * FROM tblxx WHERE O xx_date BETWEEN " & fncleto(a) & " AND " & fncdanes(b) & " ;"End Select
  15. Can somebody else help me with this one? This is the whole code,..., i din t translate it, but u will understand it. If you look at first post you will see what i am trying to do. The problem is check box because it doesent gives me the result but send me an error. If i remove the code of a check box and SELECT statement of it the code work,... , but now gives me an error written two post up. <%'funkcija, ki poskrbi za urejanje tekstaFunction uredi(tekst,akcija) 'če je akcija 1 potem vpisujemo v bazo, drugače pa beremo iz nje if akcija = 1 then 'preberemo podatke iz baze (zamenjamo odstavke z <br>) uredi = Replace(tekst,"<BR>",Chr(13)+Chr(10)) 's tem delom poskrbimo, da vse enojne narekovaje zamenjamo 'z AAA, ki jih potem pri branju iz baze pretvorimo nazaj v narekovaj uredi = Replace(uredi,"'","AAA") else If Not IsNull(tekst) Then 'preberemo podatke iz baze (zamenjamo odstavke z <br>) uredi = Replace(tekst,"<BR>",Chr(13)+Chr(10)) uredi = Replace(uredi,"AAA","'") Else 'če ni teksta za urediti vrnemo prazen string uredi="" End If end if End Function'deklaracija spremenljivkDim SQL, conn, rs %><%set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open(Server.Mappath("_db/popravila.mdb"))set rs=Server.CreateObject("ADODB.recordset")sql="SELECT DISTINCT Naziv FROM tblPopravljeno ORDER BY Naziv"rs.Open sql,connnaziv=request.form("naziv1")%><form method="post"><input type=text name="naziv1" value="Hermes d.o.o. "><input type="submit" /><%set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open(Server.Mappath("_db/popravila.mdb"))set rs=Server.CreateObject("ADODB.recordset")sql="SELECT DISTINCT Naprava FROM tblPopravljeno ORDER BY Naprava"rs.Open sql,connnaprava=request.form("naprava1")%><select name="naprava1"><% do until rs.EOF response.write("<option") if rs.fields("naprava")=naprava then response.write(" selected") end if response.write(">") response.write(rs.fields("naprava")) rs.MoveNextlooprs.Closeset rs=Nothing %></select><%set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open(Server.Mappath("_db/popravila.mdb"))set rs=Server.CreateObject("ADODB.recordset")sql="SELECT DISTINCT Popravljeno FROM tblPopravljeno"rs.Open sql,connpopravljeno=request.form("popravljeno")%><input type="checkbox" name="popravljeno" checked/></form><%if naziv<>"" & naprava<>"" & popravljeno<>"" thenDim n'SQL stavek, ki nam prikaže popravilaSQL="SELECT * FROM tblPopravljeno WHERE naziv = '" & naziv & "' AND naprava = '" & naprava & "' AND popravljeno = '" & popravljeno & "' "'odpremo tabelo z SQL stavkomSet rs = conn.execute(SQL)'če baza ni praznaif not rs.EOF then%><tr class="text_0"><td><b>Št. naloga</b></td><td><b>Naprava</b></td><td><b>Oznaka naprave</b></td><td><b>Datum prevzema</b></td></tr><tr><td> </td></tr><%'zanka za prikaz vseh novicn = 1do%><tr><!-- povezava na urejanje novice --><td><a href="?sub=edt&id=<%=rs("Popravljeno_ID")%>" class="link_1" style=" text-decoration:none"><b><%=uredi(rs("popravljeno_ID"),0)%></b></a></td><td align="left" class="text_1"><%=uredi(rs("naprava"),0)%></td><td align="center" class="text_1"><%=uredi(rs("oznaka_naprave"),0)%></td><td align="center" class="text_1"><%=uredi(rs("datum_prevzema"),0)%></td><!-- povezava za brisanje vnosa --><td><a href="?sub=edt&id=<%=rs("Popravljeno_ID")%>" class="link_1">Uredi/</a></td><!-- povezava za brisanje vnosa --><td class="text_1"><a href="?sub=del&id=<%=rs("Popravljeno_ID")%>" class="text_1">Briši</a></td></tr><tr><td colspan="6"><hr noshade size="1" color="#cccccc"></td></tr><%n = n + 1rs.MoveNextLoop until rs.EOFEnd if%> <%End if%>
×
×
  • Create New...