Welcome Guest, Not a member yet? Register   Sign In
Stuck on tutorial
#1

[eluser]Harreh[/eluser]
So I've been following the default tutorial to help get started with Codeignited, get familiar with MVC, which is all new to me.

I've gotten this far and been stopped dead. I've followed the guide precisely (aside from the 'application/view/news/success.php' error: hint, should read 'views').

From what I can see, the form_validation->run() block always gets hit despite actually entering data in the fields.
Infact, I don't even see anything even if I don't input anything to make the validation fail.
#2

[eluser]Harreh[/eluser]
Code can be found here:
https://github.com/Harreh/CodeIgniter-Tutorial/
#3

[eluser]Otemu[/eluser]
Hi,

I Just downloaded your code and gave it a try, the validation works as expected, I receive the following error message when I submit the form:

The Title field is required.

The text field is required.

These error messages are displayed above the title label and below the 'Create a news item' header. Since your doing server side validation, the page will refresh before displaying the errors as your posting the form, if it the case that you don't even want the form to be submitted but the errors to be displayed straight away, then you need to use JavaScript to achieve this.

Any more questions feel free to ask, we are a helpful bunch here most of the time Wink
#4

[eluser]Harreh[/eluser]
Not sure what we're doing differently then. I click the 'create news item' button and nothing happens.
#5

[eluser]Ckirk[/eluser]
Can you post your model, viewer and controller in here just so that we can have a look. Usually when the form validation doesn't work for me it's because I've missed something simple or made the silliest typo, which ends up in a facepalm when I eventually spot the error Smile
#6

[eluser]Harreh[/eluser]
You can browse the code on GitHub:
https://github.com/Harreh/CodeIgniter-Tutorial/
#7

[eluser]Harreh[/eluser]
edit: nevermind, I solved the below issue (this thread's issue still stands)

I'm really confused here. I think this is some issue separate to my code.

I've been following the Zend Framework tutorial (and got this far).

Basically, I've got a form more-or-less identical to the CI tutorial's form. Two text fields with corresponding labels and a "submit" button.
Yet I get the same behaviour - clicking the button does nothing.
#8

[eluser]Ckirk[/eluser]
sorry I hadn't realised that the code you linked initially was your own. My bad.
I'll take a look when I can but i'm shutting down to catch a flight so might not be for a day or 2.

With any luck someone will have helped you sort it by then Smile




Theme © iAndrew 2016 - Forum software by © MyBB