Home » Database » DB_Table » Bug #5915
radio button value do not select dynamically by default value
Details
| Submitted | 2005-11-10 03:45 UTC |
|---|---|
| From | dhirajgrmtech at hotmail dot com |
| Assigned | wiesemann |
| Status | Bogus |
| Package | DB_Table |
| PHP Version | 4.4.1 |
| OS | fedora |
| Roadmaps | (Not assigned) |
Comments
[2005-11-10 03:45 UTC] dhirajgrmtech at hotmail dot com
Description:
------------
Radio button do not support the dynamically set the value.
As at the time of editing existing form value I want to display that which radio button was checked previously. But it has no option to do so. And more it is reset when display the form on default setting.
Test script:
---------------
<?php
include_once('siteconfig.php');
$UtilityFunctionObj = new ClUtilityFunctions;
$smarty = $UtilityFunctionObj->FnGetDisplayObj();
$DBObj = ClUtilityFunctions::FnGetDBConnection();
$UserObj = new ClUser($DbObj,'phpbb_users');
$UserInfoObj = new ClUserInfo($DBObj,'TblUserInfo');
$UserBankInfoObj = new ClUserBankInfo_Schema($DBObj,'TblUserBankInfo');
//Getting the UserID
$UserID=$UserObj->FnCheckIfUserLoggedIn();
// Checking user id
if($UserID==0)
{
header("Location:/login/");
}
// After submit the step1 form processing and display the Step3 form
if(isset($Action3))
{
array_push($Step3DataArray,$UserID);
$UserInfoObj->FnSaveStep3Data($Step3DataArray);
header('location: thank-you.html');
}
else
{
// Collectng existing information for step 1
$Step3InformationArray = $UserInfoObj->FnGetUserDetailsForAdditionalInformationStep3($UserID);
if(!isset($Step3InformationArray['FldBankName']))
{
$Step3InformationArray['FldBankName'] = "";
$Step3InformationArray['FldAccountType'] = "";
$Step3InformationArray['FldABA'] = "";
$Step3InformationArray['FldAccountNumber'] = "";
$Step3InformationArray['FldDirectDeposit'] = "";
$Step3InformationArray['FldAccountExistency'] = "";
$Step3InformationArray['FldSalaryFrequency'] = "";
$Step3InformationArray[0] = $UserID;
}
// Sign up form by html_quickform
// This is for the name of the form
$Args['formName'] = 'Page3';
// this is for the type of method for form method
$Args['method'] = 'POST';
// If any field is not needed then we need to comment that field from the array $Cols
$Cols = array(
'FldBankName'=>$Step3InformationArray['FldBankName'],
'FldAccountType'=>$Step3InformationArray['FldAccountType'],
'FldABA'=>$Step3InformationArray['FldABA'],
'FldAccountNumber'=>$Step3InformationArray['FldAccountNumber'],
'FldDirectDeposit'=>$Step3InformationArray['FldDirectDeposit'],
'FldAccountExistency'=>$Step3InformationArray['FldAccountExistency'],
'FldSalaryFrequency'=>$Step3InformationArray['FldSalaryFrequency'],
);
// this is for the form action
$Args['action'] = '/my/cash/step3.html';
$FormObj = $UserBankInfoObj->getForm($Cols,'Step3DataArray',$Args);
$FormObj -> addElement('submit', 'Action3', ' Finish ','class="cms_button"');
$HtmlForm=$FormObj->toHtml();
$article['content']= $HtmlForm;
$article['header'] = '<span class="style3">Bank & Payment Information</span><hr>';
$smarty->assign('article',$article);
$smarty->display('content-page.tpl');
}
?>
Expected result:
----------------
say $Step3InformationArray['FldDirectDeposit']= 1
then it should checked the 2nd button but it always display the default checked button.
Actual result:
--------------
should be checked the 2nd button