Post Form without using Forms component ?

3 years ago

Zuko
Member | 2
+
0
-

Hi . Im new to using Nette frw

I ve just create a form in static html.Then i testing them but when i submit this post form. The method still is GET , so how i can post a form without using form component , just in html form.

my presenter :

public function renderDefault()
{
    var_dump($this->request->getMethod());
    if($this->isPost())
    {
        var_dump($this->isPost());// Just getting $this->request->post if $this->request->getMethod() == 'POST' else false
    }
}

my default block

<form role="form" name="frmok" method="post" action="extacly-link-to-my-presenter">
    <div class="form-group">
        <label class="col-md-2 control-label">Textarea:</label>
        <div class="col-md-10">
        <textarea type="text" class="form-control maxlength-handler"
                  rows="8" name="textarea"></textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="col-md-2 control-label">Options:</label>
        <div class="col-md-10">
            <label class="col-md-2 control-label">Checkbox:</label>
            <div class="col-md-3">
                <input name="checkbox" class="make-switch" checked="checked"
                       data-on-text="Check" data-off-text="not check" type="checkbox">
            </div>
            <label class="col-md-2 control-label">select:</label>

            <div class="col-md-3">
                <select class="bs-select" name="select">
                    <option>1</option>
                    <option>2</option>
                    <option>3</option>
                    <option>4</option>
                    <option selected="selected">5</option>
                </select>
            </div>
        </div>
    </div>
    <div class="form-group">

    <div class="col-md-2"></div>
    <div class="col-md-10">
            <button type="submit" class="btn btn-primary btn-lg"
                    data-loading-text="Loading....">Start
            </button>
            <button type="reset" class="btn btn-danger btn-lg">Stop</button>
            <button type="button" class="btn btn-default btn-lg">Clear</button>
        </div>
    </div>
</form>

Thank you for reading then i ll very happy if u can help me to sloved it.

Last edited by Zuko (2016-01-29 18:22)