Little problem with form

17 posts by 3 authors in: Forums > CMS Builder
Last Post: April 9, 2010   (RSS)

By Jason - March 31, 2010

Hi,

You have an error in your header page. On lines 171 and 180 change the variable $productsRecord to $productsRecords.

Give that a try and let me know.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Little problem with form

By thenetgirl - March 31, 2010

<form id="form" action="productsList.php">
<select name="product_type" class="dropdown" id="type" size="1" style="font-family: Garamond; color: #821789; font-size: 10pt" >
171----- <?php $options = getListLabels('products', 'product_type', $productsRecords['product_type']) ?>
<option>product type</option>
<?php foreach($options as $option): ?>
<option><?php echo htmlspecialchars($option) ?></option>
<?php endforeach ?> </select></td>
<td valign="top" width="6"><input src="buttons/greygo.gif" type="image" value="Search" name="I1"> </td></form>
<td valign="bottom" width="26">&nbsp;</td>
<td width="6" valign="top">
<form id="form" action="productsList.php">
<select name="treatment" class="dropdown" id="type" size="1" style="font-family: Garamond; color: #821789; font-size: 10pt" >
181 ---- <?php $options = getListLabels('products', 'treatment', $productsRecords['treatment']) ?>
<option>treatment</option>
<?php foreach($options as $option): ?>
<option><?php echo htmlspecialchars($option) ?></option>
<?php endforeach ?> </select></td>



still shows errors -
Notice: Undefined index: product_type in /home/skinsolu/www/skinsolutionsbymimi.com/include_header.php on line 171
Notice: Undefined index: treatment in /home/skinsolu/www/skinsolutionsbymimi.com/include_header.php on line 181
Patricia

www.thenetgirl.com

By Jason - March 31, 2010

Can you let me know what all of the field names are in the "products" table?
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Little problem with form

By thenetgirl - April 2, 2010

any ideas on this suppose to go live next week and this is the last bug i have left



thanks
Patricia

www.thenetgirl.com

By Donna - April 2, 2010

Hi Patricia!

Just got off the phone with you, but I think this'll be a little easier if we take a look at it directly -- would you be able to fill out a support request here?

http://www.interactivetools.com/support/email_support_form.php

Thanks, Patricia! :)
Donna

--
support@interactivetools.com

Re: [Donna] Little problem with form

By thenetgirl - April 9, 2010

Thanks Donna you were wonderful as always.

This was finally resolved the code is as follows

<?php

require_once "/cmsAdmin/lib/viewer_functions.php";

list($productsRecords, $productsMetaData) = getRecords(array(
'tableName' => 'products',

));

?>

<form id="form" action="productsList.php">
<select name="product_type">
<?php
$schema = loadSchema('products');
$fieldSchema = $schema['product_type'];
$fieldOptions = getListOptionsFromSchema($fieldSchema);

foreach ($fieldOptions as $valueAndLabel) {
list($value,$label) = $valueAndLabel;
$encodedValue = htmlspecialchars($value);
$encodedLabel = htmlspecialchars($label);
print "<option value=\"$encodedValue\">$encodedLabel</option>\n";
}
?>
</select>
<input type="submit">
</form>
Patricia

www.thenetgirl.com