Welcome Guest, Not a member yet? Register   Sign In
form proccess fail
#1

[eluser]dianikol85[/eluser]
Hi to all!

I have multiple form_open which i create dynamically by using a for loop. All the forms accept the first one do the the post as they should. But the first one doesn't do anything.

I use these forms to delete a record from a table in a db. I dont want a anchor tag and pass the id in the url.

Is this a bug or it;s my fault?
#2

[eluser]JoostV[/eluser]
As long as you make sure to close the forms as well this should work just fine. All form_open() does is create HTML like
Code:
<form action="some/url" action="get">
The problem probably lies in the way you process the form.

You can have a look at what's posted by echoing the POST values in the controller your form posts to.
Code:
var_dump($_POST);
#3

[eluser]dianikol85[/eluser]
the problem is that the submit button doesn't do anything when i click it. It acts like a button
#4

[eluser]JoostV[/eluser]
I take you coded it to be a submit Wink
Code:
echo form_submit('submitbutton', 'Submit this form!');
#5

[eluser]InsiteFX[/eluser]
Show your code for your form validation and view no one can really help you without seeing the code!

InsiteFX
#6

[eluser]dianikol85[/eluser]
it is just a regular form

Code:
<?php foreach ($users as $user) :?>
<tr>
<td align="right">
                                            <div style="margin-left: 30px;">
                                      
                                                <div class="delete_user modal_window" id="delete_user&lt;?php echo $user->u_id; ?&gt;" title="Διαγραφη">
                                                    <h3>Διαγραφή</h3>
                                                    <p style="margin-left: 3px;">Θέλετε σίγουρα να διαγράψετε τον χρήστη:  <b>&lt;?php echo $user->u_lname.' '.$user->u_fname; ?&gt;</b> </p>
                                                    &lt;?php echo form_open('admin/user/delete_user',array('class' => 'delete_form')); ?&gt;
                                                    &lt;input type="hidden" name="u_id" id="u_id" value="&lt;?php echo $user-&gt;u_id; ?&gt;" id="u_id" />
                                                    <div class="float-right" style="margin-right: 5px;">
                                                        &lt;input type="button" value="Άκυρο" class="close" /&gt;
                                                        &lt;input type="submit" value="Διαγραφή" id="submit_delete" /&gt;
                                                    </div>
                                                    &lt;?php echo form_close(); ?&gt;
                                                </div>
                                            </div>
                                        </td>
</tr>
&lt;?php endforeach; ?&gt;

the lang is greek. so dont bother. I also remove the other <td> tags to keep it clean for you guys. I don't see any wrong
#7

[eluser]Jaketoolson[/eluser]
can u paste the rendered html?
#8

[eluser]dianikol85[/eluser]
It was my mistake,

I had a form within a form, That's why it didn't do the request




Theme © iAndrew 2016 - Forum software by © MyBB