I am trying to create a coupon to apply to my items. I created a data type Coupon which has a code and a expiration date.
I have a place where I ask user to type in the code.
On enter, I would like then this field to become green and show the code in bold if the input code matches one in Coupon data as well as the exp. date as compared to current date.
If the date of the code is expired or the code is wrong then I want it to blank out the input or say, “Not valid”
Can’t get this to work.
Thanks for your help.
I think you need to include the code as a constraint within the search–not compare the input’s value to the first code in the list of codes returned by your current search.
You may also need to move the evaluation to a workflow triggered by something like a submit button, rather than in the input’s own conditions.
The input’s placeholder property governs the ghost text that appears in an empty input upon page load. Perhaps you mean to change the input’s actual value, which is governed by its initial content property.
Alex, Thank you very much. Yes this is exactly what I was trying to do. But of course, I was not even close to the way it needed to be done. Thank you again.
Best, Charan