Posted by Tom
2017-06-08
To initialize a form field, open web/form/app/cls_ps_(table-name).inc.php
Find the lines shown below:
If you change "name" to "email", then you can set the value of the email field, etc.
Find the lines shown below:
$iv = $def->GetInitValues();Insert the following two lines above "$def->ToState();"
if ( $iv != null )
{
foreach( $iv as $key=>$val )
{
$obj =& $def->GetChild( $key );
$obj->SetVal( $val );
}
}
$def->ToState();
//-- [END] Set init values
$obj =& $def->GetChild( "name" );The result should look like
$obj->SetVal( "John" );
$iv = $def->GetInitValues();The code you inserted sets the "name" field to "John"
if ( $iv != null )
{
foreach( $iv as $key=>$val )
{
$obj =& $def->GetChild( $key );
$obj->SetVal( $val );
}
}
$obj =& $def->GetChild( "name" );
$obj->SetVal( "John" );
$def->ToState();
//-- [END] Set init values
If you change "name" to "email", then you can set the value of the email field, etc.
→ Form2DB
My situation is this: I have a front end that grabs an input value from the user. The user is then directed to my modified version of your software.
I'm using cookies but cannot figure out how to insert the cookie value into the user's input form based on your software.
Help please. I can do cookies and all that but i don't know where to find I should put the 'input=cookie_value' statement. The variable you seem to use is rs:def:(input field) on tbl*...(page1).