Jump to content

scale

Members
  • Posts

    14
  • Joined

  • Last visited

Posts posted by scale

  1. Hi all,i have 2 dropdown list... 1 is month, another is year... which can let user to select which month or year they wanted to search for news. user can have 3 options to search for...1. select only month to search (1stdropdown)2. select only yar to search (2nd drop down)3. select both dropdown, means select month and year<%sql = "SELECT title, month, year, link FROM News"strWhere = " WHERE"if months <>"" thensql = sql & strWhere & " month LIKE '%" &months& "%'"strWhere = " OR"end ifif years<>"" thensql = sql & strWhere & " year LIKE '%" &years& "%'"strWhere = " OR"end ifif months<>"" and years<>"" thensql = sql & strWhere & " month LIKE '%" &months& "%' and year LIKE '%" &years& "%'"strWhere = " OR"end ifrs.Open sql, conn%>1 and 2 option can work.but the 3rd option, it did display results, but didn't merge the month and year.example i select month=january, year=2005suppose only display record for january 2005 ...but it display all record for january and 2005what i want is just only record for january and 2005any idea?thanks.

  2. <script language="JavaScript" type="text/JavaScript">function hide(){document.getElementById('a_form').sap.style.display="none";document.getElementById('a_form').clickss.style.display="none";}function show(){document.getElementById('a_form').sap.style.display="inline";document.getElementById('a_form').clickss.style.display="inline";}function onFormSubmit(){var sap = document.getElementById('sap');if (sap.value =="") {alert("Please give us some comments");return false}}</script><form action="vote/sameVoteDetail.asp" method="post" id="a_form" target="_blank" onsubmit="java script:return onFormSubmit()"><table><tr><td><input type="radio" name="Vote" value="A" checked onClick="hide();return true;"></td><td>A</td></tr><tr><td><input type="radio" name="Vote" value="B" onClick="hide();return true;"></td><td>B</td></tr><tr><td><input type="radio" name="Vote" value="C" onClick="show();return true;" /></td><td>C</td></tr></table><br><img src="1.jpg" id="clickss" style="display:none;"><textarea rows="5" cols="18" name="sap" id="sap" style="background-color:white;display:none;" ></textarea><p><input type="Submit" value="Submit"/></input></form>when i hit A and b button, it wil come out with alert box. what's the problem? suppose the alert box come out only when user didn't key in data inside textarea.Thanks.

  3. Hi all,i have 3 radio buttons, which is a, b and c, and 1 submit button. i want to do a function, for example, if i click on a and b button, it show nothing. but if i click on c button, it appear a textarea, which ask me to key in some words. how to do the onclick function? and how to alert user if not key in any words inside textarea?Thanks.

  4. im tryin to insert data into database, which data enter by user.can anyone giv me some examples?and... all data into database will then convert to excel.thanks.

  5. how to make selection on radio button then display text box???example:

    • a
    • b

    if i select b then wil display a text area below it...thanks alot.

  6. izzit like this?set rs=Server.CreateObject("ADODB.Recordset")if months <> "" and years="" thenrs.Open " SELECT title, month FROM News where month LIKE '%" &months& "%'", rs.closeelse if years <> "" and months="" thenrs.Open " SELECT title, month FROM News where year LIKE '%" &years& "%'", rs.closeelsers.Open " SELECT title, month FROM News where month LIKE '%"&months&"%' and year LIKE '%" &years& "%'", rs.closeend ifend if

  7. i try to run it, but error occur...Error Type:ADODB.Recordset (0x800A0E79)Operation is not allowed when the object is open.error line: set rs=Server.CreateObject("ADODB.Recordset")rs.Open sql, connWhat's the problem??? could any1 guide me?

  8. hi all,wat to say... is something like this...if combo1<>" AND combo2="" thensql=display combo1else if combo2<>"" AND combo1="" thensql=display combo2else sql=display combo1 and combo2how to write da full coding??? i tried many times, it cant work.

  9. now im trying to create two combo boxes... ask user to select 1st combo box(month), n 2nd combo box(year), n den search record from database. now my pro is, how to combine 2 combo boxes??? it cant work if i combine it, but can work for only 1 combo box.my codes here...if monthly<>"" thenrs.Open"Select month from tbl where month='%"&monthly"%'how to add in another combo box which is year(2nd combo box)?Thanks.

  10. k... my codes here...<%selected=Request.Form("a")Set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open"C:/Inetpub/wwwroot/ASP/db.mdb"Set rsSearch=Server.CreateObject("ADODB.Recordset")rsSearch.Open "select title from News WHERE month ='a';", connif rsSearch.EOF ThenResponse.Write("No Match")Elsedo until rsSearch.EOFResponse.Write (rsSearch("title"))Response.Write("<br>")rsSearch.MoveNextLoop%>when i select 1 of the month, for example jan, it wil display the record jan 1 2006 my 2nd diaryjuz display jan record only, n a link for my 2nd diary to another page...now, my problem is... 1)cannot search it, always display no match. 2) how to set the link???Thanks.

  11. Hi all,im trying to display a drop down list, which contain all the month inside, jan, feb, wed... bla bla bla...and then, when i choose jan, it wil display all infor of jan from database Access.could anyone help me? Thanks ya.

×
×
  • Create New...