top of page

Simple-Comment-Box

NoImage.png

User

User-ID

CODE
INFO
Project-Structure
Title
Comment
User-Pic
f7c060ed-197a-4edc-bcd4-84447dcb8226
hello! I am arthur
wqewqeqeqeqeqeq
i am an unregistrated user
57da6cbf-baea-4248-8b1c-e7e82fcc01f8
13123123123
57da6cbf-baea-4248-8b1c-e7e82fcc01f8
1312323213
eed0f48a-5824-4029-8b3f-ac8034af894b
w4wewwewqewqewqe
eed0f48a-5824-4029-8b3f-ac8034af894b
12312323ewqeqwewqewe
eed0f48a-5824-4029-8b3f-ac8034af894b
mmmm
eed0f48a-5824-4029-8b3f-ac8034af894b
wqewqewewqe
eed0f48a-5824-4029-8b3f-ac8034af894b
45rre4564564trtzr
eweqeqweqeqeqe
313121232131231223
f7c060ed-197a-4edc-bcd4-84447dcb8226

Poster:

f7c060ed-197a-4edc-bcd4-84447dcb8226

User-ID

3d3941b6-eba7-4d8e-a8e2-457be06746d6

Date:

01/19 - 01/23

Time:

01/19 - 01/23

Poster:

User-ID

f1118afd-0dfc-44e0-ad36-df1f75034951

Date:

01/19 - 01/23

Time:

01/19 - 01/23

Poster:

User-ID

069d4a7c-3555-4210-8999-1c2d64d3d65f

Date:

01/19 - 01/23

Time:

01/19 - 01/23

57da6cbf-baea-4248-8b1c-e7e82fcc01f8

Poster:

57da6cbf-baea-4248-8b1c-e7e82fcc01f8

User-ID

d1d3a763-fa95-417f-9902-4dab292be1e9

Date:

01/19 - 01/23

Time:

01/19 - 01/23

57da6cbf-baea-4248-8b1c-e7e82fcc01f8

Poster:

57da6cbf-baea-4248-8b1c-e7e82fcc01f8

User-ID

5f69ac92-b905-4171-aad8-78effe4f9b79

Date:

01/19 - 01/23

Time:

01/19 - 01/23

eed0f48a-5824-4029-8b3f-ac8034af894b

Poster:

eed0f48a-5824-4029-8b3f-ac8034af894b

User-ID

ea24dd48-b657-448c-a8ad-4c0cd9ac6d66

Date:

01/19 - 01/23

Time:

01/19 - 01/23

eed0f48a-5824-4029-8b3f-ac8034af894b

Poster:

eed0f48a-5824-4029-8b3f-ac8034af894b

User-ID

814151e5-3b11-470c-88f5-8ed034c77c9c

Date:

01/19 - 01/23

Time:

01/19 - 01/23

eed0f48a-5824-4029-8b3f-ac8034af894b

Poster:

eed0f48a-5824-4029-8b3f-ac8034af894b

User-ID

608e4416-be3f-4056-b725-9bc1feedd52e

Date:

01/19 - 01/23

Time:

01/19 - 01/23

eed0f48a-5824-4029-8b3f-ac8034af894b

Poster:

eed0f48a-5824-4029-8b3f-ac8034af894b

User-ID

87f26e6a-c20b-4247-8de6-a9150f2c6c6d

Date:

01/19 - 01/23

Time:

01/19 - 01/23

eed0f48a-5824-4029-8b3f-ac8034af894b

Poster:

eed0f48a-5824-4029-8b3f-ac8034af894b

User-ID

65160f2f-0f01-4834-976b-372b90a1228b

Date:

01/19 - 01/23

Time:

01/19 - 01/23

Poster:

User-ID

db569485-457e-498c-9a4e-c31da90ba287

Date:

01/19 - 01/23

Time:

01/19 - 01/23

Poster:

User-ID

d09b41b5-b3e1-4f3c-b8d2-31ede3b856d4

Date:

01/19 - 01/23

Time:

01/19 - 01/23

INFO

CLOSE.png

In this example you will see a simple structured comment-box.

​

To use this example you will have to register all the users in the own database --->  "Member-Data" first.

​

Just the user which are included in this database, will be able to submit comments.

CODE

CLOSE.png

import wixData from 'wix-data';

import wixUsers from 'wix-users';

 

var picData

var ownerId

var membersData

 

$w.onReady(function () {

    $w("#dataset1").onReady( () => {    

        let userId = wixUsers.currentUser.id

        console.log(userId)

        wixData.query("Member-Data")

        .eq('_owner', userId)

        .find()

        .then( (results) => {

            membersData = results.items[0];

            console.log(membersData)

            ownerId = membersData._owner;

            console.log(ownerId)

            picData = results.items[0].profilePic

            console.log(picData)

 

            $w('#input1').value=userId

            $w('#input2').value=userId

            $w('#image1').src=picData

        })

        .catch( (err) => {

            let errorMsg = err;

        });

 

        $w('#dataset2').onBeforeSave(()=>{console.log("Prepare-Data")

            $w("#dataset2").setFieldValues( {

                "title":    $w('#input1').value,

                "comment":  $w('#textBox1').value,

                "userPic":  picData

            }); 

            console.log(picData)

        })

 

        $w('#button1').onClick(async()=>{console.log("Save-Data")       

            $w("#dataset2").save()

        })

    })

})

DB-STRUCTURE

PMD (PrivateMembersData)

Databse.png
Avatar-000.png

Picture

Column-ID ---> "picture"

CLOSE.png

Your own (Member-DB)

Databse.png
Avatar-000.png

User-Pic

Column-ID ---> "profilePic"

Your own (Commets-DB)

Databse.png
Avatar-000.png

Profile-Pic

Column-ID ---> "userPic"

Comment-Box

CLOSE.png

Version-1.0

Under_Construction.png

Leave a comment. . .

Arrow.png

General-Settings

ON                 OFF

Show Text-Length

ON                 OFF

max. Text-Length

ON                 OFF

Show Key-Press

ON                 OFF

Show Key-Code

ON                 OFF

Show Total-Count

Character-limit

Load default settings
Save
russian-dima 00:08:25

! YES ! Arthur is out there XDDDDDDDD

30.7.2020
russian-dima 00:08:07

Hello! Some one out there?

30.7.2020
russian-dima 18:55:23
29.7.2020
russian-dima 17:26:48

No problem, you are welcome ;-)

24.7.2020
arthurvalatin 22:54:45

Very helpful tutorial russian-dima! Thank you so much!

24/07/2020
Page 1 of 1
Design
Settings
About
CLOSE.png
Leave a comment, or start a chat.

Post-Comment

- - -

Pressed-Key

- - -

Key-Code

Text-Length

- - -

max. Text-Length

- - -

Number of Comments

- - -

designed & developed by russian-dima

Write a comment
bottom of page