form_submit() does not post |
Hi all,
i found that codeigniter 3 has not submit my input submit value, when i declare the name. example as below:- controller : PHP Code: // set page rules view : PHP Code: <label for="title">Page Title</label> result : Code: Array in the result, it only shows me the title post variable. It should be show the result as : PHP Code: Array i had tested with native PHP, it work and keep my submit value. i don't know this consider as bug or i did something wrong? Please help~ Thanks!!!
Add type="submit" to your buttons
PHP Code: $data['save_btn'] = array( (04-19-2015, 06:21 PM)webnaz Wrote: Add type="submit" to your buttons Thanks Webnaz for reply, it doesn't work and i not generate a button, i usually generate a submit button which is according to codeigniter user guide form_submit() it does help me auto add in type="submit". and i missing one very informative info which is i using codeigniter 3 HMVC. i also tested codeingiter 3 without HMVC. Its work, but HMVC doesn't. (04-20-2015, 06:15 AM)Edwin Wrote: Thanks Webnaz for reply, it doesn't work and i not generate a button, i usually generate a submit button which is according to codeigniter user guide form_submit() it does help me auto add in type="submit". This makes it seem likely that there could be an error in the HMVC Loader. If you're calling other controllers from within any of your views, though, you could just be overwriting variables in the loader or the view.
I would guess it actually has to do with your form_validation library. This is a known challenge with WireDesignz' HMVC code. According to his docs at BitBucket:
wiredesignz Wrote:When using form validation with MX you will need to extend the CI_Form_validation class as shown below,
Hi, Guys i found the issue. is not codeigniter and HMVC problem.
The problem is my JAVASCRIPT function causing that!!! i try make the form prevent multiple click submit button. so, the moment user submit the form then i disable the submit. when the submit button is disable, it actually DO NOT POST. anyway, thanks for reply and help~
put your disable code on the SUBMIT button after you click it, so once they submit the form it disables the submit button.
(04-23-2015, 08:13 AM)CroNiX Wrote: put your disable code on the SUBMIT button after you click it, so once they submit the form it disables the submit button. Hi CroNix, Thanks for solution~ but that also is not working i had tried before, when the form is submitting the disable submit button is not posting as well. Unless you are using ajax. i have used several method to do prevent multiple submit also not working as well. method 1 ( Not Working ) $('#submit_btn').click(function(e) { e.preventDefault(); // disable button $(this).attr('disabled','disabled'); // submit form $('#form').submit(); }); method 2 ( Not Working ) $('form').submit(function() { // disable button $('#submit_btn').attr('disabled','disabled'); }); Eventually, what i done is don't disabled the button, you can use overlay to cover it or set css to button pointer-events: none; |
Welcome Guest, Not a member yet? Register Sign In |