CodeIgniter Forums
Submit botton not showing up in POST - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Submit botton not showing up in POST (/showthread.php?tid=12849)



Submit botton not showing up in POST - El Forum - 11-02-2008

[eluser]jtingato[/eluser]
I have never seen this before and it has me perplexed.
I have taken over a previously designed site ( I always hate that) which was
created using CodeIgniter. I have not used CodeIgniter before, so I am a noob.
Does CI somehow filter the POST array?

There is a form on a PHP page with a JS script for creating a sketch of some
clothing. The form accepts several choices from combo boxes with an "order" and Save function. The action of the form is to a function "sketch/doSave", which need to determine whether Save or order was clicked. The form is as follows below:

NOTE: I have redirected the form action to a php file that just uses print_r to
print the POST array. Everything shows up in the array except the submit
buttons.

************Print_r results***********
Array
(
[base] => UT300
[baseColor] => Black
[baseFabric] => L0000
[neck] => N100
[sleeve] =>
[sleeveColor] => None Available
[sleeveFabric] => None Available
[sleeveInsertColor] => None Available
[sleeveInsertFabric] => None Available
[lowertorso] =>
[lowertorsoColor] => None Available
[lowertorsoFabric] => None Available
[lowertorsoInsertColor] => None Available
[lowertorsoInsertFabric] => None Available
)
**********************************************

Where is the [save]= "Save" ?

If I copy just the button portion of the form to another php file and run it
it shows up in the POST array.

Any ideas? Please.


****************** FORM CODE*********************************
<form action="<?=site_url('postshow.php')?>" id="sketchForm" method="post">

<fieldset>

<legend>Sketch Form</legend>

&lt;!------------------------------------------------------------------------------------------------&gt;

&lt;!-- Start Button Box --&gt;

<div class="buttonBox">

&lt;input name="save" type="submit" id="save" accesskey="s" value="Save"&gt; .

&lt;input name="order" type="submit" id="order" accesskey="o" value="Order"&gt; .

&lt;input name="reset" type="button" id="reset" accesskey="r" value="Reset"&gt;

</div>

&lt;!-- End Button Box --&gt;

&lt;!------------------------------------------------------------------------------------------------&gt;

&lt;!-- Start Details Box --&gt;

<div id="details">

<div id="baseBox">

&lt;!-- Create and fill combo boxes--&gt;

<div id="baseCombo">

<label for="base">Base</label>

<select name="base" id="base" class="required main">

<option value="none" selected>-- Select a Base --</option>

&lt;?=$baseOptions?&gt;

</select>

</div>

&lt;!-- End Base Combo --&gt;

&lt;!-- Create and fill more combo boxes --&gt; ....


Submit botton not showing up in POST - El Forum - 11-02-2008

[eluser]jtingato[/eluser]
Okay. I was wondering (without any attitude at all.. I promise). Did I do something wrong in this forum. It just seems that posts were being replied to all around any of mine. I really would like to know if I did something, so I don't ever do it again.
Please advise

I did finally find that the problem lies in a JS file... "jsquery.js" I will try to look through that file for info.

Any help will be extremely appreciated. I am not familiar with this file. Is it a part of CI?


Submit botton not showing up in POST - El Forum - 11-02-2008

[eluser]Randy Casburn[/eluser]
Hi jtingato,

Quote:Did I do something wrong in this forum.

I don't really think you did.

I will tell you I tend to bypass posts with a bunch of code or lists and things that don't use the forum's tagging tools to separate them out.

I'm not sure I could have helped, but I would have taken a look had you used code tags. Hit "Post Reply" and you'll get a friendlier input form than the 'fast reply' one.

Just a thought,

Randy


Submit botton not showing up in POST - El Forum - 11-03-2008

[eluser]Mike Ryan[/eluser]
Could you post the code from your controller file? (The one that contains the function the form is normally submitted to? Like Randy says, if you put it in [code ]your code[/code ] tags (without the spaces) it will be easier to read.

This is the CI way of getting something from POST:

Code:
$something = $this->input->post('something');

Of course, that won't solve the problem with the submit buttons not showing up. ;-)


Submit botton not showing up in POST - El Forum - 11-03-2008

[eluser]obiron2[/eluser]
Buttons don't take names and values that you can pass through to $_POST; they can only be submit or reset.

Either create a radio button set or dropdown box for the Save/Order option and only have one Submit button or if you really want two submit buttons, you will need to add some code to the onClick() event that sets a hidden value or changes the action in form tag.

I would prefer the first option because it is a) easier to program and b) does not rely on users having javascript turned on.

Obiron


Submit botton not showing up in POST - El Forum - 11-21-2008

[eluser]jtingato[/eluser]
Thank you for your respoces. I didnt realize they were her till now.

I did not realize that buttons did not pass their name to the post.
In my form I have:
Code:
&lt;input name="save" type="submit" id="save" accesskey="s" value="Save" class = "required" /&gt;

Then I am trying to access it with
Code:
$order=$this->input->post('order')

I guess that won't work.

But by using print_r($_POST), shouldn't I at least get an entry for something? I was expecting order="Order", but shouldn't I at least get submit=something???

Or probably just if(isset('submit'))???