homepage Welcome to WebmasterWorld Guest from 23.23.22.200
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

Home / Forums Index / WebmasterWorld / New To Web Development
Forum Library, Charter, Moderators: brotherhood of lan & mack

New To Web Development Forum

    
hiding an image
radiobuttonlist, image hiding, server side script, client side script
Bucephalus




msg:4152268
 11:35 am on Jun 14, 2010 (gmt 0)

HI

I'm working on this website for my mate for his wedding. This is my first website. Anyway its not going too bad. Well I am putting a quiz about the couple in with multiple choice questions using a radionbutton list. This is an asp.net control, which (I may not require, but might just leave it in there now even if I don't). Anyway so there are going to be like 6 multiple choice questions and you have to choose an answer for each question and click on a submit button.

For the ones that they get wrong I want a red cross to show up on the left side of the radiobutton they selected and a green tick to show up beside the correct answer( on the left side of the corresponding radiobutton). On the ones they get correct well I just want a green tick to show up on the left side of the radio button they selected.

I would post the page I'm talking about, but I"m not sure about the rules of the forum because it is going to have my mate's name on the page and also I'm not sure if this classes as "review my site".

Anyway, the question is. How would one go about this? I thought of making a label element for each radio button that sits on the left of the radio button and has a cross if it's beside an incorrect answer and a tick beside a correct answer. Also, would I be putting the logic in server side code, or putting it in client side code. Also the hiding? Have I go tthe option to do that in server side too? Like changing a visibility attribute or would I do this in javascript.

Also how do I sit the label there? Do I use absolute positioning? I could work out how to do this. Maybe I'm just asking experienced guys here, "what is best practice"?

I can look this up myself and do it "a" way, but maybe not the easiest and most appropriate way. That is why I'm here asking this question.

David.

 

Bucephalus




msg:4152682
 3:03 am on Jun 15, 2010 (gmt 0)

Well I just went ahead and did it. I'm not sure if it's the best way, but it's a way. I used server side. I positioned little crosses and ticks beside the appropriate answers using relative positioning.
I then set them to Visible="False" (I'm using asp:Image tags).
I then just checked the logic on the associated c# file under the submit button clicked method and set the appropriate crosses and or ticks to visible.

cheers.

daveVk




msg:4152692
 3:30 am on Jun 15, 2010 (gmt 0)

would I be putting the logic in server side code, or putting it in client side code


It could go either side, if you need a record of the choices made the server needs to be involved, doing it on the client gives the user near instant feedback, you can use a combination.

On the client side, use JS to set visiblity of tick/cross/blank image based on checked state vs correct answer.

Bucephalus




msg:4152795
 8:55 am on Jun 15, 2010 (gmt 0)

Thanks Dave.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / New To Web Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved