i2-Services, Inc. Forums

Full Version: Changing checkbox places
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
From the admin form template.. I created a form.

I would like to have my question at the top and my checkbox/radio/text field under it..and not beside it.

Example:

Right now its like
Name ____________ (this can be radio/text/checkbox)

I would like
Name
_________________ (this can be radio/text/checkbox)
You can change the table code in the form template to break it in two table rows, instead of one.

Putting the question in one row, then the field in the second row.

i2-Services, Inc. Wrote:
You can change the table code in the form template to break it in two table rows, instead of one.

Putting the question in one row, then the field in the second row.


Could give me a quick example from the legend_form.php template please?

Try this for the text form field section. Report back if it works well.

Code:
<!----------- TEXT FORM FIELD ----------->


     {if ($type[customs] == "text") }
  
     <tr>
      <td colspan="2" valign="top">
         {$question[customs]}<br>
         {$sub_text[customs]}
      </td>
      </tr>
     <tr>
      <td colspan="2">
         <input type="text" name="{$field_name[customs]}" size=35 value="{$default_value[customs]}">
       </td>
     </tr>
        
    {/if}

[/quote]

i2-Services, Inc. Wrote:
Try this for the text form field section. Report back if it works well.

Code:
<!----------- TEXT FORM FIELD ----------->


     {if ($type[customs] == "text") }
  
     <tr>
      <td colspan="2" valign="top">
         {$question[customs]}<br>
         {$sub_text[customs]}
      </td>
      </tr>
     <tr>
      <td colspan="2">
         <input type="text" name="{$field_name[customs]}" size=35 value="{$default_value[customs]}">
       </td>
     </tr>
        
    {/if}


This is OK for the "Text Field", however I want to modify Radio and CHeckbox.. So I try it this, but it didnt work like the text field did..
I added colspan=2 here as well but it didnt put it under it

Code:
{if ($type[customs] == "radio") }
     <tr>
        <td colspan="2" valign=top>
            {$question[customs]}<br>
            {$sub_text[customs]}
        </td>

       <td colspan="2">
          {$answers[customs]}
       </td>
     </tr>

    {/if}

gbas Wrote:

i2-Services, Inc. Wrote:
Try this for the text form field section. Report back if it works well.

Code:
<!----------- TEXT FORM FIELD ----------->


     {if ($type[customs] == "text") }
  
     <tr>
      <td colspan="2" valign="top">
         {$question[customs]}<br>
         {$sub_text[customs]}
      </td>
      </tr>
     <tr>
      <td colspan="2">
         <input type="text" name="{$field_name[customs]}" size=35 value="{$default_value[customs]}">
       </td>
     </tr>
        
    {/if}


This is OK for the "Text Field", however I want to modify Radio and CHeckbox.. So I try it this, but it didnt work like the text field did..
I added colspan=2 here as well but it didnt put it under it

Code:
{if ($type[customs] == "radio") }
     <tr>
        <td colspan="2" valign=top>
            {$question[customs]}<br>
            {$sub_text[customs]}
        </td>

       <td colspan="2">
          {$answers[customs]}
       </td>
     </tr>

    {/if}

[/quote]

I did fix the problem, I added <tr></tr> between..it work..

However.. My question in sentence is split in 3 lines, like 2 words by line.. any idea what can be the problem

Code:
{if ($type[customs] == "radio") }
     <tr>
        <td valign=top>
            {$question[customs]}<br>
            {$sub_text[customs]}
        </td>

       <tr>
       <td>
          {$answers[customs]}
       </td>
     </tr>
    

    {/if}

This thread is now working like a charm! Smile YESSS!
Find out you had a missing closing </tr> ?

All is good?

i2-Services, Inc. Wrote:
Find out you had a missing closing </tr> ?

All is good?


I was missing </tr> at 1 place and I added colspan=2 as well which give a better look, this problem is now working!!! Smile

Great!

Overall are you pleased with the software and how flexible it is?
Pages: 1 2
Reference URL's