Coded something up in Couch in an interesting way? Have a snippet or shortcode to share? Post it here for the community to benefit.
20 posts Page 2 of 2
had to add static to handle_params() methods within a few classes to get this to work with Couch 2.0

I think that issue has to do with PHP7, not v2.0 of Couch.

Thanks for giving me a nudge. I'll get an update posted soon to correct it.
Hi, i did install the HTML5 tags addon on my Couch, im not using Couch 2.0. And the input tags are working.

But when im saving the data dont get saved. Must i add something to db_persist or something or is there anything else im doing wrong.

Code: Select all

            <cms:if k_success >
                <cms:db_persist_form />

                <cms:if k_success >
                    <cms:set_flash name='success_msg' value='1' />
                    <cms:redirect 'profile-user.php' />

            <div class="col-md-2">
                   <div class="form-group">
                           <cms:input name='mobil' type="tel" class="form-control" />
<div class="panel panel-flat">
    <div class="panel-body">
        <div class="row">
            <div class="col-md-12">
                <button type="submit" class="btn btn-primary" style='width:100%;'>OPPDATER OPPLYSNIGNER <i class="icon-arrow-right14 position-right"></i></button>

@heggeneskim, Hi :)

Only cms:inputs of type 'bound' get persisted automatically (that is what the term 'bound' suggests).

Any other type you choose to use in the form, needs to be explicitly persisted. As an example, assuming your template has an editable region named 'phone' and the form has an input named 'mobile', the following will push the value submitted in 'mobile' into the 'phone' editable region -
Code: Select all
    phone = frm_mobile

Please do notice that the variable we have used above is named 'frm_mobile' and not simply 'mobile' because, as explained in the docs on forms (, Couch prefixes 'frm_' to all input names in the success condition.

If you wish, you may search the forum and you can find many examples of <cms:db_persist_form> usage.

Hope it helps.
not works with couch2 and couch2.1beta
@andrejprus, seems to be working just fine for me on both versions.
What exactly is not working for you? Please post the code you are using.

i download zip file from 1 post attachment



then trying to use type="color"

and at output in browser at front-end I have:
The addon actually only adds new <cms:input> types and not <cms:editable> types.
That is to say, those HTML5 inputs are meant to be used on front-end forms e.g.
Code: Select all
    <cms:input type='email' name='email' validate='0' required='1' />

Hope that explains the perceived problem.
ooh, understood.. in <cms:form> thank u!!!
I use HTML5 input types and everything works well. Here is my example code;

Code: Select all
<cms:input type='range' class="range_slider" id="slider1" max="5" min="-1" step="1" list="soru_1" name="soru_1" required='1' />

When page loads the default value is 3. I want to show default value as -1.
I tried to add value="1" attribution but it didn't worked.
Do you have any suggestion about this?

It's weird. I tried your code and the default was in the middle, like you said: 3. Then I added value="-1" and refreshed... it was still 3!

I poked around in the addon code looking at how the value attribute is handled, looking for problems. I looked up the HTML5 specification to see if there's something weird about the Range input type. I tried opening the page with a different browser. Maybe it's a browser issue. I couldn't figure it out.

Then I noticed that I forgot to save the file when I changed the value attribute.

Yeah. It works. I think you must have had some sort of human error, too. Setting the value attribute should change the default value on your slider, just like you would expect.
20 posts Page 2 of 2