Categories > TinyButStrong general >

Problems with selected

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Sergey
Date: 2004-10-28
Time: 08:35

Problems with selected

Hi Skrol.
I've a problem with selected option. the payment variable, nomatter it's value 1 or 0, always selected the second variant where payment value = 1. What's the problem? Can you help me?
Thank's in advance/
<table width="100%"  border="0" cellspacing="0" cellpadding="1" class="tbl_steps">
        <tr>
          <td colspan="2">[var.payment;selected=payment; noerr]<input name="payment" type="radio" class="rb" value="0" checked></td>
          <td width="98%">[var.booking.payment.var1; htmlconv=no]</td>
        </tr>
        <tr>
          <td colspan="2"><input name="payment" type="radio" class="rb" value="1"></td>
          <td>[var.booking.payment.var2; htmlconv=no]</td>
        </tr>
      </table>
By: Skrol29
Date: 2004-10-28
Time: 10:03

Re: Problems with selected

Hi Sergey,

I tested you piece of template and it works ok for me.
I suggest that you check your variable by addin an extra tag
payment = {[var.payment;noerr]}

Is you table embeded into <form> tags?
If it's not, then you maybe see the [var.payment] value displayed, and the first item stay selected. You can fix that by using <form> tags or parameter "selbounds=table" (TBS >= 2).
By: Sergey
Date: 2004-10-28
Time: 10:41

Re: Problems with selected

Yes, my table is embede&#1074; into form. The value is 0.
but it doesn't check it anyway.
By: Skrol29
Date: 2004-10-28
Time: 10:43

Re: Problems with selected

Which TBS version do you have?
By: Sergey
Date: 2004-10-28
Time: 11:08

Re: Problems with selected

tbs 2 ce
By: peirgwnael
Date: 2004-10-28
Time: 18:41

Re: Problems with selected

Isn't it a question of form tag ?

To work, for me, this type of function must be enclosed between form tags.
<fom>  [...]
    <input type="checkbox" name="ch" />[check;selected=ch]
[...]
</form>
I use a framework and the content of the form comes from an other script without form tag and I don't understand why it dosesn't work... It was because of the absence of frm tag.

It's perhap's something else...
By: Skrol29
Date: 2004-10-28
Time: 19:13

Re: Problems with selected

Hi Sergey,

I've tested on another PC and I had the same behavior as you.
I've checked the HTML source of the result page, and the checked attribut was correctly placed on the first item when the second item was visually checked.
The browser is Firefox 0.10.1.

When I test on IE 6, all is ok.
By: Sergey
Date: 2004-10-28
Time: 20:54

Re: Problems with selected

Thanks for spending your time to help me.
But i've IE 6 and i still can't understand why it don't work
By: Skrol29
Date: 2004-10-29
Time: 11:10

Re: Problems with selected

Ive tested the following script+template on IE 6 and it worked ok with both TBS 2.0 and 2.0ce.

Could you test it and tell me if you still have the bug?
If it's so, could you sent the Html source of the result to me and indicate you PHP version.

test.php:
<?php

include_once('tbs_class_20ce.php');

$payment = 0;
$booking['payment']['var1'] = 'Option Value = 0';
$booking['payment']['var2'] = 'Option Value = 1';

$TBS = new clsTinyButStrong;

$TBS->LoadTemplate('test.htm');
$TBS->Show();

?>

test.htm:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Test</title>
<style type="text/css">
<!--
body,td,th {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 11px;
}
-->
</style></head>
<body>
<form>
<table width="100%"  border="0" cellspacing="0" cellpadding="1" class="tbl_steps">
        <tr>
          <td colspan="2">[var.payment;selected=payment; noerr]<input name="payment" type="radio" class="rb" value="0" checked></td>
          <td width="98%">[var.booking.payment.var1; htmlconv=no]</td>
        </tr>
        <tr>
          <td colspan="2"><input name="payment" type="radio" class="rb" value="1"></td>
          <td>[var.booking.payment.var2; htmlconv=no]</td>
        </tr>
      </table>

</form>
$payment = {[var.payment;noerr]}<br>
TBS version = {[var..version]}
</body>
</html>
By: Sergey
Date: 2004-10-29
Time: 12:32

Re: Problems with selected

very strange, but this variant is working...
i'll then try to find the error.
thank's for helping me. maybe my hands is in wrong place :)

your engine - is the best. thank's again :)