Jump to content

pulpfiction

Members
  • Posts

    1,210
  • Joined

  • Last visited

Posts posted by pulpfiction

  1. Try giving Response.write...... in next line.Response.ContentType = "application\octet-stream"Dim filename as string=new string("C:\Inetpub\wwwroot\tution\doc")Dim downloadFile As System.IO.FileStream = New System.IO.FileStream(filename, IO.FileMode.Open) Response.Write(downloadFile.Length() & "#")downloadFile.Close()Response.WriteFile(filename)Response.Flush()Response.End()

  2. Try this....

    SELECT	 TOP 2 *FROM		 (SELECT	 TOP 5 *					   FROM		  tbl_Name					   ORDER BY Date1 DESC) tbl_NameORDER BY Date1

    Inner query will give 11/24/200609/17/200609/02/200608/31/200607/30/2006and if you "order by" Date1 then it will be ascending order. then TOP 2 will give you the required date.Output:07/30/200608/31/2006

  3. Oh, was using alert for testing purpose...... try this code.

    <form name="qtn1" action=" "><p>What is 5+6?</p><input type="radio" value="4" name="ff">4<br><input type="radio" value="10" name="ff">10<br><input type="radio" value="11" name="ff">11<br><input type="button" value="Check!" onclick="checkIt('1')"> </form><hr /><hr /><form name="qtn2" action=" "><p>What is 10+6?</p><input type="radio" value="16" name="fi" >16<br><input type="radio" value="10" name="fi">10<br><input type="radio" value="11" name="fi">11<br><input type="button" value="Check!" onclick="checkIt('2')"></form><script>function checkIt(val){  var radioObj;  var ans;  if (val==1) {    radioObj = document.qtn1.ff;ans=11;    }  else if(val==2) {    radioObj = document.qtn2.fi;ans=16;    }  var radioLength = radioObj.length;  for(var i = 0; i < radioLength; i++) {    if(radioObj[i].checked) {      if(radioObj[i].value==ans)         alert('Correct Answer');      else	                alert('Wrong: Incorrect Answer');              }        }  }</script>

  4. Seems to be working fine. try this code...

    <html><head><title></title><script type="text/javascript"></script></head><body><form name="qtn1" onload="test()"><p id="changeThis" style="color:red;">Thanks for reading! </p><script>var para = document.getElementById('changeThis');para.onmouseover = function(){this.style.color = "blue"}para.onmouseout = function(){this.style.color = "red"}</script></form></body></html>

  5. Try this code.... to change the answer, modify the variable "ans" in javascript code.....

    <form name="qtn1" action=" "><p>What is 5+6?</p><input type="radio" value="4" name="ff">4<br><input type="radio" value="10" name="ff">10<br><input type="radio" value="11" name="ff">11<br><input type="button" value="Check!" onclick="checkIt('1')"> </form><hr /><hr /><form name="qtn2" action=" "><p>What is 10+6?</p><input type="radio" value="16" name="fi" >16<br><input type="radio" value="10" name="fi">10<br><input type="radio" value="11" name="fi">11<br><input type="button" value="Check!" onclick="checkIt('2')"></form><script>function checkIt(val){var radioObj;var ans;if (val==1) {radioObj = document.qtn1.ff;ans=11;}else if(val==2) {radioObj = document.qtn2.fi;ans=16;}var radioLength = radioObj.length;alert(radioLength);for(var i = 0; i < radioLength; i++) {        if(radioObj[i].checked) {           if(radioObj[i].value==ans)               alert('Correct Answer');	   else	       alert('Wrong: Incorrect Answer');        }    }}</script>

  6. If you are using onkeydown event, then the first time when a number is pressed, the value in textbox is null. instead use onkeyup event. try code below.

    <script type="text/javascript">function change(num){var c;c=num/3;document.getElementById("credits").value=Math.round(c)}</script><input type="text" size="2" maxlength="2" id="pages" name="pages" onkeyup="change(this.value)" />|--> It will cost you <input type="text" size="2" maxlength="2" id="credits" name="credits" />

  7. Query looks fine, error could be because, one of the field names could be reserved keyword. AFAIK "year" is reserved keyword. to overcome this, you need to give field name within square brackets []Try this qurey,mysql="insert into fofo(FirstName,LastName,Month,Day,[Year],Email,Gender,Address,City,Country,Notes) values(" & fi & "," & la & "," & mo & "," & da & "," & ye & "," & em & "," & ge & "," & ad & "," & ci & "," & cou & "," & note & ")"

×
×
  • Create New...