Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Jan 2003
    Location
    Georgia
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Can someone please help me convert this piece of code?

    Can someone please walk me thru converting the below asp code to do a html select? Below is what I have and it does not work.

    What I need converted
    Code:
    Content = Content & "<tr><td valign=top bordercolor="& BackgroundColor &">Teacher, Parent, or Student: <input type=text name=txtPermission></td></tr>"
    What I have now
    Code:
    Content = Content & "<tr><td valign=top bordercolor="& BackgroundColor &">Permission:<br>
    <SELECT type=text name=txtPermission></td></tr>
    <br>
    <OPTION SELECTED>Teacher
    <OPTION>Parent
    <OPTION>Student
    </SELECT>"
    Thank you in advance, Phillip

  • #2
    Regular Coder Feyd's Avatar
    Join Date
    May 2002
    Location
    Los Angeles, CA Maxim: Subvert Society
    Posts
    403
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    Content = "<tr>" & vbcrlf 
    Content	= Content & "	<td valign=""top"" bordercolor=" & BackgroundColor & ">Permission:<br />" & vbcrlf
    Content = Content & "	<select type=""text"" name=""txtPermission"">" & vbcrlf
    Content = Content & "		<option selected>Teacher</option>" & vbcrlf
    Content = Content & "		<option>Parent</option>" & vbcrlf
    Content = Content & "		<option>Student</option>" & vbcrlf
    Content = Content & "	</select></td>" & vbcrlf
    Content = Content & "</tr>" & vbcrlf
    Of course, it is just easier to exit out of the ASP block and echo HTML code:
    Code:
    <tr>
    	<td valign="top" bordercolor="<%=BackgroundColor%>">Permission:<br>
    	<select type=text name=txtPermission>
    		<option>Teacher</option>
    		<option>Parent</option>
    		<option>Student</option>
    	</select></td>
    </tr>
    If you don't have short tags enabled, use <%response.write BackgroundColor%> instead.
    Moderator, Perl/CGI Forum
    shadowstorm.net - subvert society

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    Content = Content & "<tr>" & vbCrLf
    Content = Content & "   <td valign=""top"" bordercolor=""" & BackgroundColor & """>Permission:<br />" & vbCrLf
    Content = Content & "      <select name=""txtPermission"">" & vbCrLf
    Content = Content & "         <option value=""Teacher"">Teacher</option>" & vbCrLf
    Content = Content & "         <option value=""Parent"">Parent</option>" & vbCrLf
    Content = Content & "         <option value=""Student"">Student</option>" & vbCrLf
    Content = Content & "      </select>"
    Content = Content & "   </td>" & vbCrLf
    Content = Content & "</tr>" & vbCrLf
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    LOL, posted while Feyd was posting...
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #5
    Regular Coder Feyd's Avatar
    Join Date
    May 2002
    Location
    Los Angeles, CA Maxim: Subvert Society
    Posts
    403
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ROFL, we did almost the exact identical code!
    Moderator, Perl/CGI Forum
    shadowstorm.net - subvert society

  • #6
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yeah, experience I suppose. I notice we also both fixed the select to reside within the table definition as well, and UNcapitalized all of the HTML tags, since that is deprecated and backwards compatible.

    Like Feyd said though, in some cases it's easier just to echo ASP in your HTML like so:
    Code:
    <tr>
       <td valign="top" bordercolor="<% = BackgroundColor %>">Permission:<br />
          <select name="txtPermission">
             <option value="Teacher">Teacher</option>
             <option value="Parent">Parent</option>
             <option value="Student">Student</option>
          </select>
       </td>
    </tr>
    However, if you're building all of the content of the page or whatever as a string (i.e. "Content"), you'd probably want to use the first method.

    P.S. As far as I know there's no such thing as select type="text".
    Last edited by whammy; 01-25-2003 at 03:55 AM.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #7
    New Coder
    Join Date
    Jan 2003
    Location
    Georgia
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up Wow


    Wow!!! What a reply. Thanks to everybody. They all worked. I did not understand echo out of asp but it worked nonetheless.

    Thanks again



  •  

    Posting Permissions

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