Click to See Complete Forum and Search --> : Code to use for a Drop Down box in an .inc file


MissSecretary
11-16-2009, 08:01 AM
Good morning...

I have a file with the .inc extension that places form fields onto an ASP page.

The fields are all text (Name, Address, City, etc)
I am trying to add another field for "Business Type" but want to put a drop down box instead of a text field and I am not sure how to do this.

To have a text field for "Business Type", the code looks like this (and works):

'--- Create a text box for 'Business Type'
Dim v_Category
v_BusinessType = "<input class='cls_Dlg_Input' type='text' name='BusinessType' value='" & InputValue_String("") & "' size='36' maxsize='64'>"

How would I turn that into a Drop Down box with this code:

<select size="1" name="BusinessType">
<option selected>Select Business Type</option>
<option value="Business Type 1">Business Type 1</option>
<option value="Business Type 2">Business Type 2</option>
<option value="Business Type 3">Business Type 3</option>
</select>

Thanks so much

yamaharuss
11-16-2009, 01:39 PM
v_BusinessType = "<select name=""BusinessType"">"
v_BusinessType = v_BusinessType & "<option selected>Select Business Type</option>"
v_BusinessType = v_BusinessType & "<option value=""Business Type 1"">Business Type 1</option>"
v_BusinessType = v_BusinessType & "<option value=""Business Type 2"">Business Type 2</option>"
v_BusinessType = v_BusinessType & "<option value=""Business Type 3"">Business Type 3</option>"
v_BusinessType = v_BusinessType & "</select>"

MissSecretary
11-16-2009, 02:04 PM
Thank you so much. Worked like a charm!

yamaharuss
11-16-2009, 02:33 PM
You're welcome.

MissSecretary
11-20-2009, 01:18 PM
Would you be willing to show me the code for a text area?

I didn't ask before because I didn't think I was going to use one.
I tried to follow your example and apply that to a text area.... didn't work.

I have this code:

v_Information = "<input type='text' name='Information' value=""" & InputValue_String(rs("Information")) & """ size='36' maxsize='255'>"

and I want that to be a text area on the form (4 rows/35 columns)

I have that field (Information) set up in the database as a memo

Thank you

yamaharuss
11-20-2009, 01:20 PM
v_Information = "<textarea name=""whatever"" ROWS=""5"" COLS=""5"">" & InputValue_String(rs("Information")) & "</textarea>"

MissSecretary
11-20-2009, 01:24 PM
Wow! That a record setting response.
and that you again very much. Of course it worked =)

MissSecretary
11-20-2009, 01:25 PM
I meant "THANK you again very much"

yamaharuss
11-20-2009, 01:25 PM
You're welcome once again.