Oct 6th, 2013, 3:53 AM
Hi,
I have a working form using the api thanks to the excellent tutorials provided. My 2 problems are getting the 'Dropdowns' and 'File' fields to refill.
I am populating the dropdowns from a database and my current code is:
<select name="address" id="address" class="art-table-left_text">
<option value="">Please Select</option>
<?php
do {
?>
<option value="<?php echo $row_regionRS['regionName']?>"><?php echo $row_regionRS['regionName']?></option>
<?php
} while ($row_regionRS = mysql_fetch_assoc($regionRS));
$rows = mysql_num_rows($regionRS);
if($rows > 0) {
mysql_data_seek($regionRS, 0);
$row_regionRS = mysql_fetch_assoc($regionRS);
}
?>
</select>
I replaced - <option value="<?php echo $row_regionRS['regionName']?>"><?php echo $row_regionRS['regionName']?></option>
with
<option value="<?php echo $row_regionRS['regionName']?>"<?php if ($fields["region"] == "<?php echo $row_regionRS['regionName']; ?>") echo "selected"; ?><?php echo $row_regionRS['regionName']?></option>
but end up with a syntax error that has defied my attempts to resolve.
The 'File' fields I have not been able to find code for and if anyone can point me in the right direction I would be most grateful.
Thanks in advance
John
I have a working form using the api thanks to the excellent tutorials provided. My 2 problems are getting the 'Dropdowns' and 'File' fields to refill.
I am populating the dropdowns from a database and my current code is:
<select name="address" id="address" class="art-table-left_text">
<option value="">Please Select</option>
<?php
do {
?>
<option value="<?php echo $row_regionRS['regionName']?>"><?php echo $row_regionRS['regionName']?></option>
<?php
} while ($row_regionRS = mysql_fetch_assoc($regionRS));
$rows = mysql_num_rows($regionRS);
if($rows > 0) {
mysql_data_seek($regionRS, 0);
$row_regionRS = mysql_fetch_assoc($regionRS);
}
?>
</select>
I replaced - <option value="<?php echo $row_regionRS['regionName']?>"><?php echo $row_regionRS['regionName']?></option>
with
<option value="<?php echo $row_regionRS['regionName']?>"<?php if ($fields["region"] == "<?php echo $row_regionRS['regionName']; ?>") echo "selected"; ?><?php echo $row_regionRS['regionName']?></option>
but end up with a syntax error that has defied my attempts to resolve.
The 'File' fields I have not been able to find code for and if anyone can point me in the right direction I would be most grateful.
Thanks in advance
John