The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
Radio displaying checked rather than showing radio selected state? - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: API (https://forums.formtools.org/forumdisplay.php?fid=17)
+--- Thread: Radio displaying checked rather than showing radio selected state? (/showthread.php?tid=2038)



Radio displaying checked rather than showing radio selected state? - Kev - Jun 28th, 2012

Hello,

New to Form Tools and working through tuts for a questionnaire. All is good appart from: if the form fails validation the word "checked" is displayed next to the selected radio button instead of showing a selected radio button?

This an extract from the code:

td>It was easy to contact my local depot</td>
<td align="center"><input name="q2a" type="radio" value="6"><?php if (@$fields["q2a"] == "6") echo "checked"; ?></td>
<td align="center"><input name="q2a" type="radio" value="5"><?php if (@$fields["q2a"] == "5") echo "checked"; ?></td>
<td align="center"><input name="q2a" type="radio" value="4"><?php if (@$fields["q2a"] == "4") echo "checked"; ?></td>
<td align="center"><input name="q2a" type="radio" value="3"><?php if (@$fields["q2a"] == "3") echo "checked"; ?></td>
<td align="center"><input name="q2a" type="radio" value="2"><?php if (@$fields["q2a"] == "2") echo "checked"; ?></td>
<td align="center"><input name="q2a" type="radio" value="1"><?php if (@$fields["q2a"] == "1") echo "checked"; ?></td>

My form action is:

<form action="<?php echo $_SERVER["PHP_SELF"]?>" method="POST">

Params:

<form action="<?php echo $_SERVER["PHP_SELF"]?>" method="POST">

Demo url http://bit.ly/MVpwjt


RE: Radio displaying checked rather than showing radio selected state? - Kev - Jun 29th, 2012

(Jun 28th, 2012, 4:42 AM)Kev Wrote: Hello,

New to Form Tools and working through tuts for a questionnaire. All is good appart from: if the form fails validation the word "checked" is displayed next to the selected radio button instead of showing a selected radio button?

This an extract from the code:

td>It was easy to contact my local depot</td>
<td align="center"><input name="q2a" type="radio" value="6"><?php if (@$fields["q2a"] == "6") echo "checked"; ?></td>
<td align="center"><input name="q2a" type="radio" value="5"><?php if (@$fields["q2a"] == "5") echo "checked"; ?></td>
<td align="center"><input name="q2a" type="radio" value="4"><?php if (@$fields["q2a"] == "4") echo "checked"; ?></td>
<td align="center"><input name="q2a" type="radio" value="3"><?php if (@$fields["q2a"] == "3") echo "checked"; ?></td>
<td align="center"><input name="q2a" type="radio" value="2"><?php if (@$fields["q2a"] == "2") echo "checked"; ?></td>
<td align="center"><input name="q2a" type="radio" value="1"><?php if (@$fields["q2a"] == "1") echo "checked"; ?></td>

My form action is:

<form action="<?php echo $_SERVER["PHP_SELF"]?>" method="POST">

Params:

<form action="<?php echo $_SERVER["PHP_SELF"]?>" method="POST">

Demo url http://bit.ly/MVpwjt


OK Found it..

I needed to remove the closing > after value:

<td align="center"><input name="q2a" type="radio" value="6"><?php if (@$fields["q2a"] == "6") echo "checked"; ?></td>

And pace it at the end:
td align="center"><input name="q2a" type="radio" value="6" <?php if (@$fields["q2a"] == "6") echo "checked"; ?> /></td>

Problem solved..