renzo.verschoor Posted October 7, 2013 Posted October 7, 2013 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.
renzo.verschoor Posted October 7, 2013 Author Posted October 7, 2013 found it.. tep_draw_button(IMAGE_BACK, 'triangle-1-w', null, 'primary', array('params' => 'name="edit_x"'))
renzo.verschoor Posted October 8, 2013 Author Posted October 8, 2013 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.....
renzo.verschoor Posted October 9, 2013 Author Posted October 9, 2013 could someone push me in the correct direction....it making me crazy :sweating:
♥kymation Posted October 9, 2013 Posted October 9, 2013 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.
renzo.verschoor Posted October 9, 2013 Author Posted October 9, 2013 Thanks Jim....I will have a look later today to see if I can change this....
renzo.verschoor Posted October 13, 2013 Author Posted October 13, 2013 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.
♥kymation Posted October 13, 2013 Posted October 13, 2013 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.
renzo.verschoor Posted October 13, 2013 Author Posted October 13, 2013 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
♥kymation Posted October 13, 2013 Posted October 13, 2013 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.
renzo.verschoor Posted October 14, 2013 Author Posted October 14, 2013 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.
renzo.verschoor Posted October 14, 2013 Author Posted October 14, 2013 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
Recommended Posts
Archived
This topic is now archived and is closed to further replies.