Login    Forum    Register    Members   Search    FAQ

Board index » Development » Programming


Image Image Image



Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: HTML -> need help
 Post Posted: Sat Jul 10, 2010 12:05 pm 
Offline
User avatar

Joined: Sun Dec 16, 2007 5:57 pm
Posts: 734
Location: Canada
So I get this html code:
Code:
0
<input id="assessment_take_answers_attributes_0_value_0" name="assessment_take[answers_attributes][0][value]" type="radio" value="0" />
1
<input id="assessment_take_answers_attributes_0_value_1" name="assessment_take[answers_attributes][0][value]" type="radio" value="1" />
2
<input id="assessment_take_answers_attributes_0_value_2" name="assessment_take[answers_attributes][0][value]" type="radio" value="2" />
3
<input id="assessment_take_answers_attributes_0_value_3" name="assessment_take[answers_attributes][0][value]" type="radio" value="3" />
4
<input id="assessment_take_answers_attributes_0_value_4" name="assessment_take[answers_attributes][0][value]" type="radio" value="4" />


and the result is:
()()()()0123

where "()" is one radio button

My questions is: how do I get it so that the numbers appear this way:
0() 1() 2() 3()


Top 
 Profile  
 
 Post subject: Re: HTML -> need help
 Post Posted: Sat Jul 10, 2010 12:53 pm 
Online
User avatar

Joined: Wed Oct 21, 2009 11:43 pm
Posts: 377
Location: Finland
What are you using too look at it?

My Webpad and Mozilla Firefox both show it right.


However, i believe you can force even faulty working ones to make it look right by using Tables

Code:
<TABLE BORDER="0">
<TR>
   <TD>0</TD>
   <TD><RADIO BUTTON></TD>
   <TD>1</TD>
   <TD><SECOND RADIO BUTTON></TD>
   ...
</TR>
</TABLE>


This will also give you possibility to center those buttons and so on.

Just remember to make Table broders and all "0", or otherwise they are visible.

There are also commands for those <TD>to give them more space between borders, even in case 0, to give you more control of the look.


edit:

Actually, a little outlook control tip.

Put one empty <TD></TD> cell between each number-radiobutton pair to make some space between them.

You can then use <TD WIDTH="20"></TD> for example to make there some space between those pairs and make it more clear looking.


Top 
 Profile  
 
 Post subject: Re: HTML -> need help
 Post Posted: Sat Jul 10, 2010 5:19 pm 
Offline
User avatar

Joined: Sun Dec 16, 2007 5:57 pm
Posts: 734
Location: Canada
thanks bugala
I'm using firefox to look at it, but I think it might be something to do with the css used for the site.... I'll look into it some more later and will post results


Top 
 Profile  
 
 Post subject: Re: HTML -> need help
 Post Posted: Fri Jul 16, 2010 2:04 pm 
Offline
User avatar

Joined: Thu Jul 10, 2008 3:52 pm
Posts: 72
Location: Michigan
You should be using the <label> tag for your radio button labels. Try this:

Code:
<form>
  <label for="0">0</label>
  <input type="radio" name="options" id="0" checked="checked" />
  <label for="1">1</label>
  <input type="radio" name="options" id="1" />
  <label for="2">2</label>
  <input type="radio" name="options" id="2" />
  <label for="3">3</label>
  <input type="radio" name="options" id="3" />
  <label for="4">4</label>
  <input type="radio" name="options" id="4" />
</form>


This code displays correctly for me.

Also, in order to make your site compliant and accessible, I strongly suggest that you use CSS-P (CSS positioning with <div> tags) instead of falling back on tables as bugala suggested. Tables (as defined) are specifically intended for holding tabular data, and were never meant for use in site layout.

Edit: Oops... forgot the "name" attribute needs to be the same on each button to group them. Fixed.


Top 
 Profile  
 
 Post subject: Re: HTML -> need help
 Post Posted: Sat Jul 17, 2010 10:11 pm 
Offline
User avatar

Joined: Sun Dec 16, 2007 5:57 pm
Posts: 734
Location: Canada
thanks guys, seems that something in the website layout is messing everything up... I didn't know that the way things where displayed could be modified that much by the site layout files(I guess that would be css???)... The design guy on our team will fix it. I'm still curious as to exactly what was happening, but will probably find out later.


Top 
 Profile  
 
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 5 posts ] 

Board index » Development » Programming


Who is online

Users browsing this forum: No registered users and 1 guest

 
 

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to: