using checkbox not based on database

Results 1 to 2 of 2

Thread: using checkbox not based on database

  1. #1
    Join Date
    Dec 1969

    Default using checkbox not based on database

    Hello Guys,<BR><BR>I would like to know how i can use checkboxes which are not related to an database table. What i want to do is to use a list of items (extracted from an database). Behind each item i want a checkbox which allows my users to select one or several items. Based on this selection i want to insert the selected item(s) into a database table.<BR><BR>I hope someone can help me.<BR><BR>Thanks in advance

  2. #2
    Join Date
    Dec 1969

    Default RE: using checkbox not based on database

    &#060;FORM&#062;<BR>&#060;INPUT Type=CheckBox Name="FavoriteFoods" Value=1&#062; Hot Dogs<BR>&#060;INPUT Type=CheckBox Name="FavoriteFoods" Value=2&#062; Hamburgers<BR>&#060;INPUT Type=CheckBox Name="FavoriteFoods" Value=3&#062; Pizza<BR>&#060;INPUT Type=CheckBox Name="FavoriteFoods" Value=4&#062; Sushi<BR>...<BR>&#060;/FORM&#062;<BR><BR>***********************<BR><BR>& #060;%<BR>... make your DB connection ...<BR><BR>strFoods = Request("FavoriteFoods")<BR>arrayFoods = Split( strFoods, ", " ) &#039; that&#039;s a comma and a space!<BR><BR>For fnum = 0 To UBound( arrayFoods )<BR>&nbsp; &nbsp; SQL = "INSERT INTO favoriteFoodsTable (userID, foodID ) " _<BR>&nbsp; &nbsp; &nbsp; &nbsp; & " VALUES( " & userID & "," & arrayFoods(fnum) & ")"<BR>&nbsp; &nbsp; conn.Execture( SQL ) &#039; add one food for one person<BR>Next &#039; next food<BR><BR>

Posting Permissions

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