Ok , maybe a hard one to explain. I have a form that is built using PHP Form Builder Class
Which looks like:
$form = new form("firstForm");
$form->setAttributes(array(
"width" => 600,
"noAutoFocus" => 1,
"jsIncludesPath" => "lib/php-form-builder-class/includes",
"action" => "uploader.php"
));
$form->addTextbox("Enter a Title:", 'title' , $row['title']);
$form->addTextbox("Enter a Promo Code:", "promo" , $row['promo']);
$form->addWebEditor("Description", "description", $row['description'], array("basic" => 1));
$form->addWebEditor("Terms and Conditions", "terms", $row['terms'], array("basic" => 1));
$form->addHidden("img_urls", $row['img_urls']);
$form->addHidden("destination", $row['destination']);
$form->addHidden("header", $row['headerimg']);
$form->addHidden("cmd", "submit_0");
$form->addButton();
$form->render();
I want to add some jQuery to one of the elements to allow drag and drop, so I’ve made another form element:
?>
<form id="firstForm" action="uploader.php" method="post" >
<ul class="sortable">
Mags Select:
<?
foreach ($profiles as $mag) {
?>
<div id="sorty"><input type="checkbox" name="units" value="<? echo $mag ?>" /><label><? echo $mag ?></label><br /></div>
<? } ?>
</ul>
</form>
How can I make the jQuery part post through its values ‘units’ when the PHP Form Builder Class is submitted?
Ive had a look at adding a method to the class, but wondered if there was an easier way?
EDIT:
The PHP Form Builder Class form is self contained, so wherever the jQuery form is in the page, it will always be outside the other.
You could use javascript and transfer the values from the second form INTO (hidden fields in) the first form?
Or similarly you could just build the form and copy the HTML (view source) and use that instead of the raw php, then slot your jQuery drag and drop thing into it that way.