Skip to content

Instantly share code, notes, and snippets.

@gregfroese
Created January 28, 2009 02:09
Show Gist options
  • Select an option

  • Save gregfroese/53772 to your computer and use it in GitHub Desktop.

Select an option

Save gregfroese/53772 to your computer and use it in GitHub Desktop.
public function editAboutMe_ajax($params) {
$form = SilkForm::create_form_start(array("remote" => "true", "url" => "/silk/mp/portfolio/saveAboutMe_ajax"));
$form .= SilkForm::create_input_textarea(array("value" => $params["description"], "cols" => "60", "name" => "description"));
$form .= SilkForm::create_input_hidden(array("name" => "id", "value" => $params["id"]));
$form .= "<br />";
$form .= silkform::create_input_submit(array("value" => "Save"));
$form .= SilkForm::create_form_end();
$this->show_layout = false;
$resp = new SilkAjax();
$resp->replace_html("#AboutMe", $form);
return $resp->get_result();
}
public function saveAboutMe_ajax($params) {
$this->show_layout = false;
$resp = new SilkAjax();
// $portfolio = orm("portfolio")->find_by_id($params["id"]);
// $portfolio->description = $params["description"];
// $portfolio->save();
// $resp->replace_html("#AboutMe", $params["description"]);
$resp->replace_html("#AboutMe", "It worked");
return $resp->get_result();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment