Results 1 to 3 of 3

Thread: passing select box value error

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Columbia, SC USA
    Posts
    374

    Unhappy

    I have a select box in a form. Everything worked fine until yesterday when I had to change the code around for reasons beyond my control. Now, the receiving form does not recognize that the select box has a value.

    I am almost positive that the error is in the following code, and I think it may have something to do with the quotes around the control name "cmbFacility" But of course I am not sure and am not getting anywhere. Help?? Thanks!
    Code:
    rsFacility.MoveFirst
    response.write "<tr><td>"
    response.write "<b>Select Facility: </b></td><td><SELECT NAME="
    response.write "cmbFacility" 
    response.write "SIZE=1 DEFAULT=True>"
    
    Do While Not rsFacility.EOF  'define the ListBox options
    	response.write "<OPTION VALUE=" & rsFacility("FAC_NAME") & ">" & rsFacility("FAC_NAME")
    	rsFacility.MoveNext
    Loop
    
    response.write "</SELECT></td></tr>"
    Last edited by DrewDog_21; Apr 6th, 2001 at 08:51 AM.

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Columbia, SC USA
    Posts
    374
    Answered my own question. For the curious, I needed to use chr(13):
    Code:
    rsFacility.MoveFirst
    response.write "<tr><td>"
    response.write "<b>Select Facility: </b></td><td><SELECT NAME="
    response.write chr(13) & "cmbFacility" & chr(13)
    response.write "SIZE=1 DEFAULT=True>"
    
    Do While Not rsFacility.EOF  'define the ListBox options
    	response.write "<OPTION VALUE=" & rsFacility("FAC_NAME") & ">" & rsFacility("FAC_NAME")
    	rsFacility.MoveNext
    Loop
    
    response.write "</SELECT></td></tr>"

  3. #3
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    In actuality the problem was that you had no space between cmbFacility and SIZE=1...

    so the name of the select box was cmFacilitySIZE=1

    quotes areound things in html is not necessary (YET!)
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width