1 Replies - 1118 Views - Last Post: 30 January 2009 - 10:24 PM

#1 fran101  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 91
  • Joined: 01-December 08

dynamic asp page

Post icon  Posted 30 January 2009 - 09:30 PM

I am currently designing website in asp using DW cs4. I have set up a questionnaire which feeds the results to an access database, and am currently designing a page to display the results entered on the questionnaire page.

I can get the text and numbers to display on the webpage but can anyone tell me how to get a yes/no check box to display either checked or uncecked depending on the value being fed by the value of the field in the database.
Is This A Good Question/Topic? 0
  • +

Replies To: dynamic asp page

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 5186
  • View blog
  • Posts: 13,914
  • Joined: 18-April 07

Re: dynamic asp page

Posted 30 January 2009 - 10:24 PM

When you select the record the yes/no field is going to be true/false or 1/0. You test for these values in the record and if it is "true" or 1 you will add the "checked" property to your checkbox.

if rs("yesnofield") = true or rs("yesnofield") = 1 then
	 response.write "<input type='checkbox' checked='checked' value='mycheckbox'/> Checkbox name"
	 response.write "<input type='checkbox' value='mycheckbox'/> Checkbox name"
end if

Hope you get the idea. Enjoy!

"At DIC we be checkbox checking code ninjas... we also cross check in hockey, write checks, eat rice chex, and check for lice." :snap:
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1