Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

button question 2.2 -> 2.3


renzo.verschoor

Recommended Posts

Posted

Hi All,

 

I'm trying to convert some buttons from OSC version 2.2 into OSC version 2.3.

However on one add-on I'm unable to get it working.....the button line looks as follow:

 

echo tep_image_submit('button_back.gif', IMAGE_BACK, 'name="edit"') . '  ';

 

what does it do!!....it is going back to a form which is keeping the data filled, this is also my issue as when I try to use a tep_draw_button then my data is gone...

Does any one knows how to make a tep_draw_button out of this tep_image_submit?

 

Thanks in advance.

Posted

another question, which i need to resolve for this form.....

I got the following code as 'insert' button.....it is working (putting my inputs into the database), but redirecting to the same page as i want to have it redirect towards another page. Anyone knows how to do that?

 

here is the code:

echo tep_draw_button(IMAGE_INSERT, 'triangle-1-e', null, 'primary');

 

I already treid to change the 'null' into href, but that was not working....atleast it did redirect to the correct page, but does not upload my inputs to the database.....so I need both, upload my inputs to the database and after redirect to other page.....

Posted

Your button is a form submit, so you need to change the target of the form it is in. Look for the tep_draw_form() above that.

 

Regrds

Jim

See my profile for a list of my addons and ways to get support.

Posted

Jim/All, treid to change the target, however it is not working as after I change the target my data is not being submitted to the database anymore....

 

The orginial form lines are as follow:

 

echo tep_draw_form($form_action, 'account_add.php?cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '') . '&action=' . $form_action, 'post', 'enctype="multipart/form-data"');

....

....

echo tep_draw_button(IMAGE_INSERT, 'triangle-1-e', null, 'primary');

</form>

 

This is sending my data to the database, however i'm redirected to the same page which I do not want.....

Instead of going to 'product_add.php' I need to go to product_manage.php, but still need to submit my form data.

 

I treid to change it to the following:

 

echo tep_draw_form($form_action, '', 'post', 'onsubmit="return linkaccountmanage();" enctype="multipart/form-data"');

....

....

echo tep_draw_button(IMAGE_INSERT, 'triangle-1-e', null, 'primary');

</form>

<script>

function linkaccountmanage(){

location.href='mywebsite/account_add.php?cPath='+'<?php echo $cPath; ?>'+'<?php echo (isset($HTTP_GET_VARS['pID']) ?'&pID=' . $HTTP_GET_VARS['pID'] : '');?>'+'&action='+'<?php echo $form_action; ?>';

location.href='mywebsite/account_manage.php';

return false;

}

</script>

 

it does first open the account_add.php and then directly after goes to account_manage.php, but it is still not passing my data to the database.....

 

Does anyone knows/see/advise on what I'm doing wrongly here?

 

Thanks in advance.

Posted

You have changed the form target to a null, which should make it fail, and then attempt to override that with a Javascript. I'm impressed that you made that do anything other than return an error message.

 

Is there some reason you can't just put the correct target in the form and junk the Javascript?

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Posted

Hi jim, when i use the original code the data is being submitted to the database, however a blank screen popsup after that.....the only thing i need is it to be redirected to another page after submitting the data.....could you provide any code for me? What should i have done different? I'm not a guru, but a newby

Posted

Does the correct page open (or try to open) when you click on the submit button? If so, you have an error in your code on that page. Check your PHP error log or turn on error reporting in your includes/application_top.php. If it's not going to the correct page, change the target of the form so that it does.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Posted

Hi Jim, by using the original code:

 

echo tep_draw_form($form_action, 'account_add.php?cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '') . '&action=' . $form_action, 'post', 'enctype="multipart/form-data"');

....

....

echo tep_draw_button(IMAGE_INSERT, 'triangle-1-e', null, 'primary');

</form>

 

I do not get any error.

Nevertheless, after the submit, the header get loaded, only the body and footer are blank.....looking like i'm missing code after the submit, which should refresh the page......any ideas?

 

Thanks in advance.

Posted

Problem has been solved...Under the 'insert' action I have added some code to return table with info and a return to main button...next to that I also included the footer again....

 

Thanks for the help

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...