I own a website and using php for the shopping cart... I am trying to have 2 <?php echo tep_draw_form (....) ?> work around the same bit of coding... namely my orders on my order.php page. As soon as I put them both where they should be, one works but the other doesn't.
I am not very knowledgeable and I've tried to get some help but either I am not asking the right question or I am not asking in the right place... either way, I'd really appreciate any help at this point, I am more then a bit desperate. I've been searching every archives I could find and can't find what I need.. it's been well over 2 weeks now that I am stuck with this issue.
Thanks for reading.
NightShift58
03-14-2007, 10:02 PM
Can you post the code that's causing the problems?
mariemeh
03-14-2007, 11:15 PM
ok... let me try and I apologize in advance for being so clueless
See the 2 lines I've put in blue ... well I am trying to insert this line
<?php echo tep_draw_form('UpdateStatus', FILENAME_ORDERS,tep_get_all_get_params()); ?>
right before the other tep_draw_form line I highlighted in blue avove... and I would be closing after the other...
it would more or less look like this with all the other code in between
(code removed to make this shorter but would still be there on my page)
<tr>
<td colspan="7"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php echo '<tr><td colspan="7">' . tep_black_line() . '</td></tr>';?>
when I do this, there is a conflict and only one of the 2 options works ... I am trying to figure out if there is a way to have both work in pretty much that order.
NightShift58
03-14-2007, 11:53 PM
You can have more than one form on a page but you can't embed them in one another or overlap them, as you will end up with a jurisdiction problem.
mariemeh
03-15-2007, 12:02 AM
and I am guessing that there is no way to create an if string that would tell the page to use one code over the other depending on what button is being clicked on?
and thank you very, very much for helping me.
NightShift58
03-15-2007, 12:14 AM
and I am guessing that there is no way to create an if string that would tell the page to use one code over the other depending on what button is being clicked on?If you're referring to a button clicked on the previous page/script, yes there is.
If you want that to happen within the page, you'll have to delve into DOM, javascript and CSS - but it's technically feasible.
The easiest is probably to have two pages, each with its own form. If the user clicks on a specific button, send him/her to the other page, with the alternate form, and vice-versa.
mariemeh
03-15-2007, 12:25 AM
ok... if I go with the 2 pages... is there a way that I can tell the system to update or refresh the first one and also go to the second page?
I already have the code to go with it to have it do all I wanted at once BUT and it's a big but for me... as soon as I click the button that will activate this option, it goes to the 'print_batch_process.php' which is fine but I would need the page I was on to refresh on it's own... I understand that the proper code is calling the name of the page to be updated in this case it would be FILENAME_ORDERS,tep_get_all_get_params()); but I don't know if it's feasible to rewrite this line <?php echo tep_draw_form('batch_orders', 'print_batch_process.php', '', 'post', 'target="_blank"'). "\n"; ?> and make it refresh my first page with an if string or something.
NightShift58
03-15-2007, 12:31 AM
Let me see... I'm not sure I understand what you need.
Usual Scenario:
User is on a page and clicks on something.
Based on that, you send the user to Page1.php and display a form.
User completes the form and - depending on the information entered - is taken to the next page.
I don't see a need to refresh.
What am I missing?
mariemeh
03-15-2007, 12:46 AM
on the first page which is the page I look at the orders I have waiting...
I can with this option... select individually each orders or check them all and get all the invoices for those selected sent to be printed all at once... and I can also update the status of those selected orders at the same time.
As it is, when I click the said button... my invoices appear in the second page that opens and at the same time my status on my orders will update because of this code on that second page
my question is can I tell that code to go update my first page... the reason for this is that we work with many windows at once and on more then one PC. By not updating on it's own to reflect the changed status, we end up with errors or doing double entries for nothing... which just once isn't bad but all day long can be pretty annoying. So I am trying to find a way to change this.
NightShift58
03-15-2007, 01:10 AM
If the first page, the orders status page, had its own unique name, something could probably be done in javascript. On closing the second page, which, from what I understand, is really a popup from the first one, you could send an update "command" back to the first one.
When I say close, I don't mean the little red "X" at the top right corner of your window but something like a close button.
Such a solution would work on 1 PC. How to implement that across a network would be a challenge.
mariemeh
03-15-2007, 01:23 AM
do you have an idea where I could find an example or explanation of how to write this command on closing?
NightShift58
03-15-2007, 04:08 AM
Take a look at this fairly good tutorial:
http://codepunk.hardwar.org.uk/bjs12.htm
mariemeh
03-15-2007, 01:45 PM
thank you... most appreciated I will go read it all.
webdeveloper.com
Copyright Internet.com Inc., All Rights Reserved.