Welcome Guest, Not a member yet? Register   Sign In
Repopulating Form being displayed through Jquery UI tabs interface
#11

[eluser]Timothy_[/eluser]
[quote author="InsiteFX" date="1298028458"]When you use:
Code:
$this->load->vars($data);
It makes all the variables global to all views.

So if you have a view that loads other views the variables will be available to the other views.
If you just pass $data to a view with other views in it, the other views will not see the variables.

InsiteFX[/quote]

Thank you for clarifying this...

@Basketcasesoftware:

No I am using 1.7.2. Surely there must be a way to pass the post data between methods, we are even in the same controller.

I have been thinking, perhaps I need to store all post to a temporary table in my mysql db. But then again thats just like reinventing flash data.
#12

[eluser]Basketcasesoftware[/eluser]
How is your form data being submitted. The user guide code example has the following:
Code:
<?php echo form_open('form'); ?>

<h5>Username</h5>
&lt;input type="text" name="username" value="&lt;?php echo set_value('username'); ?&gt;" size="50" /&gt;

<h5>Password</h5>
&lt;input type="text" name="password" value="&lt;?php echo set_value('password'); ?&gt;" size="50" /&gt;

<h5>Password Confirm</h5>
&lt;input type="text" name="passconf" value="&lt;?php echo set_value('passconf'); ?&gt;" size="50" /&gt;

<h5>Email Address</h5>
&lt;input type="text" name="email" value="&lt;?php echo set_value('email'); ?&gt;" size="50" /&gt;

<div>&lt;input type="submit" value="Submit" /&gt;&lt;/div>

&lt;/form&gt;

I see you follow this pattern in your code except for that last part. I don't see anything that causes the "Submit" to take place. Does the JQuery functions handle that somehow?

You might want to consider upgrading to 2.0, 1.7 might have bugs that are hindering you.
#13

[eluser]Timothy_[/eluser]
Sorry i knew i forgot something

Its just a normal submit
Code:
&lt;input type="submit" value="Save" /&gt;

I think I am to far in my project to upgrade to 2.0 and just dont have the time to go down that road yet.
#14

[eluser]Basketcasesoftware[/eluser]
From what I'm seeing everything should work. Would you be comfortable zipping up your work and emailing it to me? I suspect something else might be missing from what you've given. I can try it with a 2.0 install on my development system. And, again, I'll agree to not disclose any proprietary information or use it compete with you or your company. If I get it to work you'll get yourself an upgraded CI platform out of the bargain.
#15

[eluser]Basketcasesoftware[/eluser]
At least a polite "yes" or "no" answer would have been nice...
#16

[eluser]Timothy_[/eluser]
Thank you very much for your kind offer. Unfortunately I am not comfortable in providing the complete source of my project. But thank you again for your offer and I really appreciate you writing back to my question when no one else would.

It would be interesting to hear from the CI developers on how much of this has changed from 1.7.2 and if anyone else thinks 2.0 could be the answer.
#17

[eluser]Timothy_[/eluser]
[quote author="Basketcasesoftware" date="1298037823"]At least a polite "yes" or "no" answer would have been nice...[/quote]

Sorry about the delay in getting back to you. I was on the train home from work. I did not mean to offend you.
#18

[eluser]Basketcasesoftware[/eluser]
LOL. Oh. Ok. That makes sense. I have no idea what time zone you are in. It's 2 am here. And I understand you being uncomfortable sharing your code. I'll try to see if I can get your code fragments to work, but I'm not sure what kind of data or table structure to use or anything. I may just try building from scratch but right now my own projects are getting even further behind. I'm self-employed.

Conversion is mostly moving your application out of the system folder, prefixing all your CI objects with "CI_" (like Controller becomes CI_Controller), and changing your object constructors into the PHP 5.0 format.
So
Code:
class Myclass extends Controller
{
function Myclass($args)
{
  parent::Controller();
  // Your initialization code
}
}
becomes
Code:
class Myclass extends CI_Controller
{
  function __construct($args)
{
  parent::__construct();
  // Your initialization code
}

}

That tends to be about the sum of it. The 2.0 User Guide goes into more detail. It's usually that simple.
#19

[eluser]xerobytez[/eluser]
Have you considered using Ajax to post the form? Then you wouldn't have to worry about repopulating. Here is an awesome jQuery library you can use to easily convert a normal form into an ajax form.

http://jquery.malsup.com/form/

Good luck man!
#20

[eluser]Timothy_[/eluser]
[quote author="Basketcasesoftware" date="1298061740"]That tends to be about the sum of it. The 2.0 User Guide goes into more detail. It’s usually that simple.[/quote]

Thankyou very much for this explanation. Codeigniter 2.0 looks very very good but our first priority is to make more sales on our product before we spend more time upgrading the core.

[quote author="xerobytez" date="1298061740"]Have you considered using Ajax to post the form? Then you wouldn't have to worry about repopulating. Here is an awesome jQuery library you can use to easily convert a normal form into an ajax form.

http://jquery.malsup.com/form/

Good luck man![/quote]

Hello xerobytez,

Thanks for your reply. Thats a really good idea which theoretically solves the problem by not creating it in the first place!!!

However I have been looking over it and am worried about how I can return inline error messages in the form from the server side field validation. So far I have only found this page that mentions validation: http://jquery.malsup.com/form/#validation

I hope there is a way to show error messages inline from the server validation, rather than through javascript alerts from jquery validation...

Thanks,

Tim




Theme © iAndrew 2016 - Forum software by © MyBB