Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
Is there any way to prevent Couch from prefilling fields with a previous selection when in edit mode?

This is being used in conjunction with the Members Module. I allow for a "Quick Registration", where a member provides only an email (also used as a username) and password. Before they can purchase anything they must fully register, which requires them to fill out the other fields defined in the members template. Since many of these fields are "required" I had entered "junk" data in there, which I intended to be replaced by the member when they fully register. I don't want them to see this "junk" data.

Is there any way to accomplish what I'm looking to do?
I think you can do that by not using 'bound' fields - use normal inputs instead.
Upon successful form submission, explicitly feed the posted values to cms:db_persist_form.

For example, suppose your template has an editable region named 'dob'. Following is how we use it in a databound manner
Code: Select all
<cms:if k_success >
   <cms:db_persist_form />
</cms:if>

<cms:input type="bound" name="dob" />

You need to convert it to the following, which works the same (but doesn't show the previous values as now the field is not bound to the editable region) -
Code: Select all
<cms:if k_success >
   <cms:db_persist_form
       dob=frm_my_dob
    />
</cms:if>

<cms:input type="text" name="my_dob" required='1' />

Does this help?
Excellent suggestion, I will take that approach. I assume it will still do all the field validation I have build into the 'cms:editable' definitions, even though they aren't truly 'bound' fields, right?
The fields won't be bound to your editable regions, so they won't know anything about the validation. You should apply the needed validation within the input tags just like KK used required='1' in the example above.
4 posts Page 1 of 1
cron