Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: RE: Combo box


Message #1 by "Sertial, Sam" <2495XX2@a...> on Thu, 21 Dec 2000 11:51:27 -0500
Hi Ron,

I have a question about combobox:

After populating the combobox from a SQL database, the combo is populated

correctly but the value of first record is assigned to the form:

I do not want to see the first line; I used this code   

 

<script Language="vbscript">

   Sub Window_OnLoad()

     

	<% 

	do while not RsSite.EOF

	%>

	

	  set objOption = document.CreateElement("option")

	  

	  objOption.text = "<%= RsSite("Address")%>"

	  objOption.value = "<%=RsSite("id")%>" 

      document.all.cboSiteId.add objoption 

		 

<%

	RsSite.MoveNext 

	   Loop

%>

Any suggestion please

Sam



-----Original Message-----

From: Drew, Ron [mailto:RDrew@B...]

Sent: Thursday, December 21, 2000 8:52 AM

To: ASP Web HowTo

Subject: [asp_web_howto] Guestbook





I wrote the following script after feedback from one of you nice people.  I

am now getting a permission denied message which displays a no page found

message.  Please take a quick look at it and let me know if I have done

something wrong or does the ISP have to do something...procedure is

TGUESTBOOK.HTML calls TADDGUEST.HTML which in turns calls

MERGEGUEST.ASP..not sure where it goes from there yet.



<%@ Language=VBScript %> 



<% 

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 

'Gets the Parameters from Guestbook Form 

 function GetFields() 

 Dim strRealname, strUsername, strCity, strState, strCountry, strURL,

strHowfound, strPrivate, strMessage 

   strRealname = Request.Form("realname") 

   strUsername = Request.Form("username") 

   strCity = Request.Form("city") 

   strState = Request.Form("state") 

   strCountry = Request.Form("country") 

   strURL = Request.Form("url") 

   strHowfound = Request.Form("howfound") 

   strPrivate = Request.Form("private") 

   strMessage = Request.Form("message") 

   Response.Write strRealname 

   Response.Write strUsername 

   Response.Write strCity 

   Response.Write strState 

   Response.Write strCountry 

   Response.Write strURL 

   Response.Write strHowfound 

   Response.Write strPrivate 

   Response.Write strMessage 

 end function 

%> 



<HTML> 

<HEAD> 

<title>Merge Guestbook with input Form</title> 

</HEAD> 

<BODY> 

<pre> 

<% 

   Response.Write GetFields() 

   dim strtext,objStream 

   set objFile = server.CreateObject("Scripting.FileSystemObject") 

   set objStream = objFile.OpenTextFile("tguestbook.html",2) 

   'set objStream = server.CreateObject("ADODB.Stream") 

   'objStream.Open "URL= http://www.xxx.com/guestbook/tguestbook.html

<http://www.xxx.com/guestbook/tguestbook.html>

",adModeReadWrite,adOpenStreamFromURL 

   objStream.Charset = "Ascii" 

   objStream.SkipLine(21) 

   strtext = "<B>" & strMessage & "</b><br>" & _ 

           strRealname & "<br>" & _ 

           strCity & ", " & strState & "  " & strCountry & "<br>" & _ 

           "<a href='mailto:" & strUsername & ">" & _ 

           strUsername & "</a><br>" & _ 

           strURL & "<br>" & _ 

           "Found Us by: " & strhowfound & "<br>" & _ 

           "Private Message? " & strPrivate & "..you must be kidding!!<br>"

& _ 

           date() & "<hr><br>"     

   objStream.Write strtext 

   objStream.Close 

 set objStream = nothing 

 set strtext = nothing 

%> 

</pre> 

<P> </P> 

</BODY> 

</HTML> 







Ron Drew













---

MaximumASP offers enhanced hosting solutions on the Windows 2000 platform. Dedicated processor, RAM, and server resources provide
dedicated server performance at virtual server prices. Commercial components provided; custom components allowed.

---

You are currently subscribed to asp_web_howto as: $subst('Recip.EmailAddr')

To unsubscribe send a blank email to leave-asp_web_howto-$subst('Recip.MemberIDChar')@p2p.wrox.com


  Return to Index