Welcome Guest, Not a member yet? Register   Sign In
Form Helper help..
#1

[eluser]psychoder[/eluser]
Controller:
Code:
$attributes = array('name' => 'student_form', 'id' => 'student');
        $hidden = array('student_id' => $student_id);
        $output .= form_open('', $attributes,$hidden);
        $output .= form_close();

View:
Code:
echo $output;

i want to have this.....

Code:
<form action='' name='student_form' id='student'>
       <input type='hidden' name='student_id' value='value_student_id'>
       </form>

the result is

Code:
<form action='http://localhost:8080/Codeigniter_try/index.php/' name='student_form' id='student'>
       <input type='hidden' name='student_id' value='value_student_id'>
       </form>

how can i use
Code:
form_open
without action...
i wanna use ajax...

tnx in advance...

regards...
#2

[eluser]Eric Barnes[/eluser]
The action automatically inserts. The best way in your case is to just over ride in the ajax call.
Code:
$('#student').submit(function(){
// do your stuff
return false;
});
#3

[eluser]Zaher Ghaibeh[/eluser]
have you tried this one :
Code:
form_open('');
#4

[eluser]Eric Barnes[/eluser]
[quote author="Zaher Ghaibeh" date="1310736556"]have you tried this one :
Code:
form_open('');
[/quote]

That will not work any longer. Via the change log -
Quote:Changed the logic for form_open() in Form helper. If no value is passed it will submit to the current URL.
#5

[eluser]Zaher Ghaibeh[/eluser]
[quote author="Eric Barnes" date="1310753648"][quote author="Zaher Ghaibeh" date="1310736556"]have you tried this one :
Code:
form_open('');
[/quote]

That will not work any longer. Via the change log -
Quote:Changed the logic for form_open() in Form helper. If no value is passed it will submit to the current URL.
[/quote]

thanks for correcting me ..
#6

[eluser]psychoder[/eluser]
tnx guys for the replies...

tnx eric for helping me out...

regards...




Theme © iAndrew 2016 - Forum software by © MyBB