Login Retreive lost passwordRegister
Search

Forum Index / General / blank page on text area update

[ This topic is solved ]

  jelle 16 July 09 / 09:52  
Changed at 16 July 09 / 10:06
Hi,

im trying to put a 7500 character text into a textarea and it gets posted to a blank page.

[website]/content.php?page=update&id=2

- i tried to bypass text validation script but no luck.
- the database field is a 'text', i tried 'longtext' also but it didnt help.
- i also checked the text on special chars. but copying the same word gave me the same error.

Anyone formiliar with this problem?

btw. i found this in the doc: "Note: When submitting vary much data please dont use the FH_TEXT validator. The validator is to time/memory expensive and submitting will fail. For small and normal amounts of data you can just use FH_TEXT."

how to unable the validator?

greets,
Jelle

  Johan Wiegel (Admin) 16 July 09 / 10:23  
Please post the code for the form, so we can see what you try to do.

  jelle 16 July 09 / 10:30  
Changed at 16 July 09 / 14:39
its complicated to show all of my code but this is the main code to build the form:

    

require_once('models/Content.class.php');
        
class ContentView extends FormHandler{
    
    private $contentModel;
    //private $parent;
    
    public function __construct()
    {
        parent::__construct();
        parent::setMask(FH_WM_ROW_MASK);
        $this->contentModel = new Content();
    }
    
    public function addItem($button="Voeg pagina toe", $oncorrect="addItem"){
        
        parent::hiddenField("id");
        parent::textField("Titel", "page", FH_STRING);
        parent::textarea("Inhoud", "text", FH_TEXT);
    
        parent::setErrorMessage("page", "Vul de titel van de pagina in");
        parent::onCorrect(array(&$this->contentModel, $oncorrect));
        parent::submitButton($button, "submit", "class='knop'");
        
        return parent::flush(true);
    }
    
    public function editItem($item){
        
        $this->addItem($button="Pas pagina aan", $oncorrect="editItem");
        
        parent::setValue("id", $item->id);
        parent::setValue("page", $item->page);
        parent::setValue("text", reverse_data($item->text));
        
        return parent::flush(true);
    }




i try to update a content page. edititem sets values into the additem form.

removing FH_text doesnt work, changing it to _FH_TEXT doesnt help either.

  Marien 16 July 09 / 10:51  
Changed at 16 July 09 / 10:55
Passing the value null in the validator option will disable the validator.

Why are you trying to use the whole parent in a child class by accessing it by its parent selector? Normally this is better:

<?php
class FH extends FormHandler
{
    function 
somefunction()
    {
        
$this->hiddenField(1,2);
        return 
$this->flush(true);
    }
}
?>


Or do you have the overruling child functions?

  jelle 16 July 09 / 11:17  
i tried:

parent::textarea("Inhoud", "text", null);

it doesnt give the error but it doesnt get saved in the database either....

  Marien 16 July 09 / 11:39  
Changed at 16 July 09 / 11:40
You are saving it in the onCorrect function or do you use the database function of FH?

(This because I think it has to do with the way you want to save it)

  jelle 16 July 09 / 12:56  
Changed at 16 July 09 / 14:55
SOLVED:

parent::textarea("Inhoud", "text", null);
// adding null to validation bypasses validation.

$text = addslashes($data['text']);
// adding addslashes to text receiver fixed the saving issue.

Thanks for your help though!

  Top


powered by PHP-GLOBE   © 2004 - 2012 FormHandler. All rights reserved.   -   Open source license