christophdb

christophdb supports this item

Supported

This author's response time can be up to 2 business days.

Popular questions for this item

Is it possible to have the label on top of the input fields?

Yes this is possible. Simply add the following code to the .css file:
#FAV label { float: left; }
#FAV td { float: left; display: block; width: 100%; }

How can I get the values from the form?

There are two possibilities to get the values from the form:
a) use directly GET or POST variables
b) store the values as a session and get them via session

Example for a)
$fav->addTextInput(‘Your name’, ‘name’);
get the values with the PHP order: $_GET[‘name’] or $_POST[‘name’]. But be aware that the values is only available directly after the submittion of the form.

Example for b)
$fav = new formsAndValidation('ex1');
$fav->save2Session(); 
echo $_SESSION['ex1']['name'];

Best regards, Christoph

How do I create a selection list with values from a database and how do I define a default value?

Step1: create an array with values from the database:
$tmp_location = array();
$sql_query = mysql_query("SELECT * FROM locations");
while($location = mysql_fetch_assoc($sql_query)){
    $tmp_location[$location['id']] = $location['description'];
}
Step 2: define a default values:
$fav->addDefaultValue('location', '3'); // 3 is the id of the desired location entry
Step 3: use the array in the selection list:
$fav->addSelectList('Choose the location', 'location', $tmp_location );

Contact the author

This author provides limited support for this item through this item's comments.

Item support includes:

  • Availability of the author to answer questions
  • Answering technical questions about item’s features
  • Assistance with reported bugs and issues
  • Help with included 3rd party assets

However, item support does not include:

  • Customization services
  • Installation services

View the item support policy

by
by
by
by
by
by