Sorry for my bad english.
I’ve have a Dynamic Page with some information of a product. I put un container expand/collapse in order de visitors can write yours reviews. I use a container because with a lightbox i had a lot of problems.
In WixEditor any problem. I can write rewiews that are saved in your database . In Web, not saved.
This is a little part of code:
The two functions that I use por save the review
$w.onReady( function () {
$w(“#ComentarisDataset”).onBeforeSave(reviewsBeforeSave);
$w(“#ComentarisDataset”).onAfterSave(reviewsAfterSave);
});
The button that expand the container where are all the imputs for the review
export function addReview_click(event) {
$w(‘#InComentari’).expand()
}
The button that save the reviews, connected with the database “reviews” and mode “send”
export function NCEnviar_click(event) {
$w(‘#InComentari’).collapse()
}
The function that catch the id de main database - dynamicDataset - and put in the other database - ComentarisDataset -
export function reviewsBeforeSave() {
let Id = $w(‘#dynamicDataset’).getCurrentItem()._id;
$w(“#ComentarisDataset”).setFieldValue(‘recipeId’, Id);
let item = $w(“#ComentarisDataset”).getCurrentItem();
}
The function that confirm that the reviews is saved
export function reviewsAfterSave() {
$w(‘#InComentari’).collapse()
}
In the WixEditor all is ok and work fine. In the Web, the container not collapse and of course ther reviews is not saved. HELP!!!