We are currently using Sabenzas 'Ultimate Product Reviews and Ratings' module and I would like to add a new required field to the review form. Essentially I want to randomly present the customer with a question and have that field required. In addition I want to test that answer to a variable created to hold the proper answer.
My understanding of the toolkit function is that it recognizes the field in question and then tests its value in a created '_SYSTEM' page using criteria lade out with store morph code.
This is what I first attempted to do.
'WREVIEWS' page:
<input type="text" name="questionAnswer" id="questionAnswer" value="&mvte:global:questionAnswer;" class="textfield" />
<mvt:item name="toolkit" param="systemaction|ADPR|WREVIEWS|The test question must be filled correctly" />
'WREVIEWS_SYSTEMS' page: (g.qn is a variable that holds the correct answer.)
<mvt:if expr="g.Action EQ 'ADPR'">
<mvt:if expr="g.questionAnswer EQ g.qn OR g.questionAnswer EQ g.qn1 OR g.questionAnswer EQ g.qn2 OR g.questionAnswer EQ g.qn3">
<mvt:else>
<mvt:item name="toolkit" param="mvassign|tkmessage|encodeentities(g.tkmessa ge)" />
<mvt:item name="toolkit" param="mvassign|tkscreen|encodeentities(g.tkscreen )" />
<mvt:item name="toolkit" param="vacreate|error_message|g.tkmessage|," />
<mvt:item name="toolkit" param="sassign|Error_Message_Count|1" />
<mvt:item name="toolkit" param="vassign|Error_Messages|l.all_settings:error _message" />
<mvt:item name="toolkit" param="vassign|Screen|g.tkscreen" />
</mvt:if>
</mvt:if>
<mvt:exit>
I also tried substituting the "ADPR" for the field name/variable "questionAnswer". In addition I tried just testing for NOT ISNULL on the 'WREVIEWS_SYSTEMS' page I created, instead of comparing the variable to 'g.qn'.
Thanks in advance for any help.
My understanding of the toolkit function is that it recognizes the field in question and then tests its value in a created '_SYSTEM' page using criteria lade out with store morph code.
<mvt:item name="toolkit" param="systemaction|ADPR|PROD|Year of Birth must be between 1900 and 1994" />
In the example provided by Emporium Plus 'ADPR'is the Action to be checked. I don't understand what this is. Is it a variable created from an input field? I found some hints to this on the forums but it doesn't seem right considering the '_SYSTEM' page example uses
<mvt:if expr="g.Action EQ 'ADPR'"> as its first logic test.
(I know I am missing some basic knowledge here, like the purpose for the g.Action Variable and how to leverage it. Its probably, a big thing.)This is what I first attempted to do.
'WREVIEWS' page:
<input type="text" name="questionAnswer" id="questionAnswer" value="&mvte:global:questionAnswer;" class="textfield" />
<mvt:item name="toolkit" param="systemaction|ADPR|WREVIEWS|The test question must be filled correctly" />
'WREVIEWS_SYSTEMS' page: (g.qn is a variable that holds the correct answer.)
<mvt:if expr="g.Action EQ 'ADPR'">
<mvt:if expr="g.questionAnswer EQ g.qn OR g.questionAnswer EQ g.qn1 OR g.questionAnswer EQ g.qn2 OR g.questionAnswer EQ g.qn3">
<mvt:else>
<mvt:item name="toolkit" param="mvassign|tkmessage|encodeentities(g.tkmessa ge)" />
<mvt:item name="toolkit" param="mvassign|tkscreen|encodeentities(g.tkscreen )" />
<mvt:item name="toolkit" param="vacreate|error_message|g.tkmessage|," />
<mvt:item name="toolkit" param="sassign|Error_Message_Count|1" />
<mvt:item name="toolkit" param="vassign|Error_Messages|l.all_settings:error _message" />
<mvt:item name="toolkit" param="vassign|Screen|g.tkscreen" />
</mvt:if>
</mvt:if>
<mvt:exit>
I also tried substituting the "ADPR" for the field name/variable "questionAnswer". In addition I tried just testing for NOT ISNULL on the 'WREVIEWS_SYSTEMS' page I created, instead of comparing the variable to 'g.qn'.
Thanks in advance for any help.
Comment