Welcome Guest, Not a member yet? Register   Sign In
scriptaculous Ajax.InPlaceEditor
#1

[eluser]Greg Aker[/eluser]
Yet another question from me. Sorry...

I'm trying to get the scriptaculous in place editor happening.

I can get it to change on the page, and watching firebug, everything seems ok, but I can't get it to actually post to my database...

Can anyone tell me what I'm doing wrong?

JS:

Code:
document.observe ('dom:loaded', function() {
    new Ajax.InPlaceEditor('question', "/index.php/editors/questionEditor");                          
});

The DOM ID of what I'm changing is "question."


here's my controller specified in the js above:

Code:
function questionEditor()
    {
        $question = $_REQUEST['value'];

        $urlSegment = $this->uri->segment(3);
        $this->db->query('UPDATE test SET question = "$question" WHERE ques_num = "$urlSegment"');

        echo $question;
    }


Thanks in advance :-)

-greg
#2

[eluser]Greg Aker[/eluser]
Ok, not trying to bump my post. I promise.

I have it figured out, but I still have one tiny road block, and I hope someone can help.

I'm trying to "POST" the third URI segment to go to the editor controller, but it doesn't seem to want to work. The URI segment corresponds with the "ques_num" in the above post. If I hard code a uri segment into my mysql query, it works.

Thanks,

-greg
#3

[eluser]SamCris[/eluser]
hi mr.greg, how did u manage to solve the inplaceeditor? i tried using it for editing the information of my registered companies, i have this code:

a test view:
Code:
<p id="companyname">&lt;?php echo $supplier->companyname;?&gt;</p>
[removed]
new Ajax.InPlaceEditor('companyname', '/supplier/edit/&lt;?php $supplier->supplierid;?&gt;/companyname');
[removed]

my controller:
Code:
function edit($supplierid, $field){
        $this->supp_model->supplierid = $supplierid;
        $this->supp_model->$field = $this->input->post("value");
        $this->supp_model->save();
        echo $_POST("value");
    }

what happens is that i see the company name of which i want to click and edit. when i hover around it, it changes its color as by default, but when i click it, the name disappears and is nowhere to be found.. amazing.. in short, there seems to be an error or something.

what must i do to correct this? anyone?
#4

[eluser]SamCris[/eluser]
Good day!

i transfered the [removed]..[removed] tag to the &lt;head&gt; part and thats how i got the "edit form" to show up but still im having a real a killer time with it...

it im wondering if anyone out there cud help me with it. i managed to get the "edit form" to show up with the ok button and cancel link, but it stays there.. i mean, i can type in what i want to change but when i click "Ok", it stuck up at "Saving...", any idea why this happened?

wat i wanted is that i will show the details of the registered company, and instead of a single edit button at the bottom, i wud want them to directly click on the information they want to change and it will be edited in place, updated in the database, and the new information the user just edited is shown.

thanks in advance.. and more power to us all.




Theme © iAndrew 2016 - Forum software by © MyBB