Advertisement:

Author Topic: Publish button does nothing PLEASE HELP!!!!  (Read 1040 times)

freckles

  • Newbie
  • *
  • Posts: 5
Publish button does nothing PLEASE HELP!!!!
« on: September 09, 2014, 07:16:20 pm »
I'm new to osclass. Have version 3.4.1 installed, attempting to use modern theme version 4.0.1. With the bender theme, everything works as it should. With the modern theme the button on the first page to take the user to post something works fine. Then once you are on the item-post page and fill out the information and click publish nothing happens. No error message, nothing.

I don't like the bender theme or else I would stick with that. 

What file do I need to look at in order to correct this?

This is the form code from item-post.php:

Code: [Select]
<form name="item" action="<?php echo osc_base_url(true);?>" method="post" enctype="multipart/form-data">
                <fieldset>
                <input type="hidden" name="action" value="item_add_post" />
                <input type="hidden" name="page" value="item" />

<button type="submit"><?php if($edit) { _e("Update"'modern'); } else { _e("Publish"'modern'); } ?></button>

Please help, I'm trying to get this working asap!

You can view the website I am trying to get this to work with  here.

teseo

  • Hero Member
  • *****
  • Posts: 6158
Re: Publish button does nothing PLEASE HELP!!!!
« Reply #1 on: September 09, 2014, 07:45:00 pm »
Hi,

Where did you get that code? Looks a bit weird to me... ???

Anyway, your Submit button is outside of the form that it's supposed to submit, so it does nothing. Restore the vanilla Modern item-post.php script and see if it works...

Regards

freckles

  • Newbie
  • *
  • Posts: 5
Re: Publish button does nothing PLEASE HELP!!!!
« Reply #2 on: September 09, 2014, 09:06:59 pm »
I was just including the beginning and ending code for the form in the item-post.php file, below the button is the closing form tag. Even with a fresh install of the modern theme the publish button still does nothing.

teseo

  • Hero Member
  • *****
  • Posts: 6158
Re: Publish button does nothing PLEASE HELP!!!!
« Reply #3 on: September 09, 2014, 10:03:36 pm »
No, I was looking at the source code, but yes, I was wrong.

Look, when you disable Javascript the Submit button works, so I would do something with those scripts you have inside the form element. You could try disabling them provisionally, then if it works that way try to move them to another place.

Regards

freckles

  • Newbie
  • *
  • Posts: 5
Re: Publish button does nothing PLEASE HELP!!!!
« Reply #4 on: September 09, 2014, 10:27:59 pm »
I'm not sure what scripts you are referring to? I have not added any scripts that did not come with the template. I downgraded to modern template 3.0.2, it seems to work although that doesn't really solve the issue.

teseo

  • Hero Member
  • *****
  • Posts: 6158
Re: Publish button does nothing PLEASE HELP!!!!
« Reply #5 on: September 10, 2014, 12:03:11 am »
I was referring to this inline script inside the HTML code for the form:

Code: [Select]
<script type="text/javascript">
                        var catPriceEnabled = new Array();
                        catPriceEnabled[1] = 1;catPriceEnabled[9] = 1;catPriceEnabled[10] = 1;catPriceEnabled[11] = 1;catPriceEnabled[12] = 1;catPriceEnabled[13] = 1;catPriceEnabled[14] = 1;catPriceEnabled[15] = 1;catPriceEnabled[16] = 1;catPriceEnabled[17] = 1;catPriceEnabled[18] = 1;catPriceEnabled[19] = 1;catPriceEnabled[20] = 1;catPriceEnabled[21] = 1;catPriceEnabled[23] = 1;catPriceEnabled[24] = 1;catPriceEnabled[25] = 1;catPriceEnabled[26] = 1;catPriceEnabled[28] = 1;catPriceEnabled[29] = 1;catPriceEnabled[97] = 1;catPriceEnabled[30] = 1;catPriceEnabled[96] = 1;catPriceEnabled[99] = 1;catPriceEnabled[98] = 1;catPriceEnabled[102] = 1;catPriceEnabled[100] = 1;catPriceEnabled[101] = 1;catPriceEnabled[105] = 1;catPriceEnabled[104] = 1;catPriceEnabled[107] = 1;catPriceEnabled[106] = 1;catPriceEnabled[116] = 1;catPriceEnabled[110] = 1;catPriceEnabled[113] = 1;catPriceEnabled[115] = 1;catPriceEnabled[109] = 1;catPriceEnabled[103] = 1;    $("#catId").change(function(){
                            var cat_id = $(this).val();
                            var url = 'http://goodwinblog.org/usedbooks/index.php';
                            var result = '';

                            if(cat_id != '') {
                                if(catPriceEnabled[cat_id] == 1) {
                                    $("#price").closest("div").show();
                                    // trigger show-price event
                                    $('#price').trigger('show-price');
                                } else {
                                    $("#price").closest("div").hide();
                                    $('#price').val('') ;
                                    // trigger hide-price event
                                    $('#price').trigger('hide-price');
                                }

                                $.ajax({
                                    type: "POST",
                                    url: url,
                                    data: 'page=ajax&action=runhook&hook=item_form&catId='   cat_id,
                                    dataType: 'html',
                                    success: function(data){
                                        $("#plugin-hook").html(data);
                                    }
                                });
                            }
                        });
                        $(document).ready(function(){
                            var cat_id = $("#catId").val();
                            var url = 'http://goodwinblog.org/usedbooks/index.php';
                            var result = '';

                            if(cat_id != '') {
                                if(catPriceEnabled[cat_id] == 1) {
                                    $("#price").closest("div").show();
                                } else {
                                    $("#price").closest("div").hide();
                                    $('#price').val('') ;
                                }

                                $.ajax({
                                    type: "POST",
                                    url: url,
                                    data: 'page=ajax&action=runhook&hook=item_form&catId='   cat_id,
                                    dataType: 'html',
                                    success: function(data){
                                        $("#plugin-hook").html(data);
                                    }
                                });
                            }
                        });
                    </script>

Regards