I am manually making a form in order to comment the feelings of the visitors.
The form is basic !
NAME COMMENT SEND
Those informations are going in a database called “comments”. The name goes in the “name” field, and the comment goes on the “comment” field.
For practically reasons, I would like to put the url of the current page in a “url” field. However, I don’t want for the visitor to manually insert it. So how, without the interaction of the user, I can add the url to the infos sent by the user ?
Thanks for the help !
Vincent
PS : If you want to see it, the form is at the end of the page https://www.vudecypres.com/copie-de-au-dessus-de-la-brume
PS2 : I already tried a “read-only” box with the url put in it, but as it is not put but the user, the wrting process in the database doesn’t include the URL.
Hi Tall ! Thank you for your answer !
Your code was almost correct, but he .text had to be replaced by .value (I don’t know yet how to code, but I tested plenty of things and this worked)
Here is my code :
import wixData from ‘wix-data’;
import wixLocation from ‘wix-location’;
Hello !
I tried to use path (and all the other functions of wixLocation, but it doesn’t work anymore, even the code I wrote in my last post here !
Do you know what’s wrong ?
// Pour toute la documentation API, y compris des exemples de code, visitez http://wix.to/94BuAAs
import wixData from 'wix-data';
import wixLocation from 'wix-location';
$w.onReady(function () {
let url = wixLocation.url;
$w("#textBox4").value = url;
});
Thanks Roi, though I find it quite complicated to follow, especially since I want to use a free API like sendinblue (SendGrid not being free of charge)
Note that I created the video in November and it still works … allows up to 100 free emails per day. (Unless you need more than that … you should be good.) See pic …
I have made this code for a website, the objective is to have a form that stores the user’s input as well as automatically the store page url in a database.
However, it is not working, any part of it.
I appreciate any help you can give me.
Thanks.
import wixData from ‘wix-data’;
import wixLocation from ‘wix-location’;
$w.onReady(function () {
let url = wixLocation.url;
$w(“#textelement1”).text = url.toLocaleString();