This topic is locked

Radio Button Horizontal?

11/6/2006 2:59:26 PM
ASPRunnerPro General questions
H
haggecha author

Is there a way to make the Radio Buttons to go horizontal instead of a vertical list? I ave a survey with alot of qustions and five answers, I would like the radion button to display horizntally to save space.

Sergey Kornilov admin 11/6/2006

You need to modify generated include/commonfunctions.asp file for this purpose.
Find function BuildRadioControl(field, value,secondfield)
In this function code replace all "
"
with " ".

I
inflectionpt 3/10/2007

What is I need to put individual radio buttons in separate cells? Seems like there is no easy to customize the formatting.
For example, I have a radio button named A. A could have values of 1,2,3,4,5,6,7. I want to put 1 thru 7 in individual table cells. How do you recommend I do this?

You need to modify generated include/commonfunctions.asp file for this purpose.

Find function BuildRadioControl(field, value,secondfield)
In this function code replace all "
"
with " ".

J
Jane 3/13/2007

James,
you can do the following:

  • open include/commonfunctions.asp file


  • find this code snippet:

    for each opt in arr

    if arr.Item(opt)=value then

    response.Write "<input type=""Radio"" name=""radio_" & cfieldname & """ onclick=""java script: " & cfield & ".value='" & db_addslashes(arr.Item(opt)) & "'; return true;"" checked>" & myhtmlspecialchars(arr.Item(opt)) & "
    "

    Else

    response.Write "<input type=""Radio"" name=""radio
    " & cfieldname & """ onclick=""java script: " & cfield & ".value='" & db_addslashes(arr.Item(opt)) & "'; return true;"">" & my_htmlspecialchars(arr.Item(opt)) & "
    "

    end if

    next


  • and replace it with this one:

    response.write "<table border=1><tr>"

    for each opt in arr

    if arr.Item(opt)=value then

    response.Write "<td><input type=""Radio"" name=""radio_" & cfieldname & """ onclick=""java script: " & cfield & ".value='" & db_addslashes(arr.Item(opt)) & "'; return true;"" checked>" & myhtmlspecialchars(arr.Item(opt)) & "</td>"

    Else

    response.Write "<td><input type=""Radio"" name=""radio
    " & cfieldname & """ onclick=""java script: " & cfield & ".value='" & db_addslashes(arr.Item(opt)) & "'; return true;"">" & my_htmlspecialchars(arr.Item(opt)) & "</td>"

    end if

    next

    response.write "</tr></table>"