View Full Version : how to have 2 two tep_draw_form around the same code

03-15-2007, 04:24 AM
I searched the archives for this


but unfortunately, none of those is helping accomplish what I am trying to or I am not understanding which is a definite possibility.

I am trying to find a way to work 2 <?php echo tep_draw_form(...); ?> around the same bit of code... on my php order page...

is there anyway that this can work?

03-15-2007, 04:47 AM
I read your question 4 times and still don't know what you are talking about.

Try asking your question again and pretend like we don't know anything about what you are trying to do.

03-15-2007, 05:12 AM
sorry I will try to do better...

I own a website that uses a OSC shopping cart. I've been working on it to make it more efficient. So far so good... even with my verrrrrrry limited knowledge, I've been able to build something I can actually work with... only a week and a half ago I hit a snag... I have two options that need to work around the same code... here is the part of the code that is my concern on my order.php page

<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php echo tep_draw_form('batch_orders', 'print_batch_process.php', '', 'post', 'target="_blank"'). "\n"; ?> <tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRINT; ?><input name="allbox" type="checkbox" value="Check All" onclick="CheckAll(document.batch_orders);" /></td>
<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_CUSTOMERS; ?></td>
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ORDER_TOTAL; ?></td>
<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_DATE_PURCHASED; ?></td>
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_UPDATE; ?></td>
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>

( I am cutting out part of the code to make this brief cause )

<td colspan="7"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php echo '<tr><td colspan="7">' . tep_black_line() . '</td></tr>';?>

<td class="smallText">Batch Print - Invoice:<?php echo tep_draw_radio_field('target_file', FILENAME_ORDERS_INVOICE, true); ?> Packing Slip:<?php echo tep_draw_radio_field('target_file', FILENAME_ORDERS_PACKINGSLIP, false); ?> Invoice &amp; Packing Slip:<?php echo tep_draw_radio_field('target_file', 'both', false); ?> Labels:<?php echo tep_draw_radio_field('target_file', 'labels'); ?></td>
<td class="smallText" align="right">
<?php echo tep_image_submit('button_confirm.gif', IMAGE_CONFIRM, 'align="absmiddle"'). "\n"; ?> </td>
<?php echo '</form>'. "\n"; ?>

Note the 2 lines that are in blue... this is my first tep_draw_form.... the second one would normally go exactly in the same spot... for the second option to work...
<?php echo tep_draw_form('UpdateStatus', FILENAME_ORDERS,tep_get_all_get_params()); ?> and of course it's closing code would be at about the same spot as the other one...

As soon as i try to put both form in the same spot... there is a conflict and one works and the other doesn't. Like I said my knowledge in this is limited but I really really do need for this to work so I am trying to find out if it's at all possible to have another <?php echo tep_draw_form...?> showing in the code before the closing the for the first one shows...

I don't knwo if I could illustrate it better like this... I know what I am going to write isn't related at all to this but I thought maybe it would give an image

in HTML... you can't insert a <table> tag inside another <table> tag... but if I do this


then I can have a table inside another...

I am trying to figure out if I can have one form code work inside another form code??

am I making any more sense?? sorry for being so illetarate at this.

03-15-2007, 09:19 AM
I understand much better. The function tep_draw_form() is not a PHP function, but a user-defined function within you code, so that's why I didn't know what you were talking about. And no I can't help you specifically with that function since I don't have any idea what it is or what it does.

Your desire to do <form name="form1"><form name="form2"></form></form> is not valid HTML markup and most every browser will be confused by it (and it won't do what you want it to).

There is always another way to do things though...

03-15-2007, 09:21 AM
thanks for your reply, I appreciate it