top of page

Forum Posts

chajj
Jan 15, 2019
In Coding with Velo
Hello! Hope someone can guide me on how to solve this. I have a form that submits into a database through code. When the user clicks Submit, the code works and it submits to the database successfully. However, it submits twice. As if the user clicked twice on the Submit button (when they've clicked once). I have created forms through code multiple times but this is the first time this has happened. I was wondering what may be the cause and how to resolve it. Thank you! import wixData from 'wix-data'; export function button71_click(event) { console.log("Clicked"); let toInsert = { "referralNetwork": true, "firstName": $w('#firstName').value, "lastName": $w('#lastName').value, "email": $w('#email').value, "companyName": $w('#company').value, } wixData.insert("SiteMembers", toInsert) .then( (results) => { let item = results; $w('#text337').show(); SendClientEmail(); wixLocation.to("/account/my-account") } ) .catch( (err) => { $w('#text338').show(); let errorMsg = err; } ); }
0
7
284
chajj
Dec 15, 2018
In Coding with Velo
Is there a way whether through code or not to assign a Label to a contact when they successfully purchase a certain plan through the Paid Plan app?
0
3
117
chajj
Nov 26, 2018
In Coding with Velo
I have a sign up page with the code below. Everything is working right. Contacts and Members are showing in the Members and Contacts List with the information in the right custom fields. However, there is one field I cannot figure the value of and that is the Address field (street, city, zipcode...). What is the right syntax or field value of the Address field? $w.onReady(function () { $w('#submit').onClick( () => { let email = $w('#email').value //correct let password = $w('#password').value //correct let firstName = $w('#firstName').value //correct let lastName = $w('#lastName').value //correct let phone = $w("#phoneNumber").value let street = $w("#street").value; let city = $w("#city").value; let state = $w("#state").value; let zipCode = $w("#zipcode").value; let company = $w("#companyName").value; //correct let companyType = $w("#employerType").value;//correct wixUsers.register(email, password, { contactInfo: { "firstName": firstName, //correct "lastName": lastName, //correct "phones": [phone], "street": street, "city": city, "state": state, "zip code": zipCode, "company": company, "Company Type": companyType, } } )
0
14
313
chajj
Nov 13, 2018
In Coding with Velo
I am trying to use wix pay api to let my site visitors pay after filling out a form I created with wix code. However, i don't want them to re-enter their information when they click Proceed to Payment. They already have filled out their first name, last name, email, phone number, and price (the quantity is set to 1 by default). I just want the information to be passed on to the payment window when it opens: The backend code: payment.jsw import wixPay from 'wix-pay-backend'; export function createMyPayment() { return wixPay.createPayment({ items: [{ firstName: "XYZ", lastName: "CXZ", email: "noreply@noreply.org", phone: "1234567890", name: "Donation", price: 10 }], amount: 10 }); } The client side code: import {createMyPayment} from 'backend/payments'; import wixPay from 'wix-pay'; import wixWindow from 'wix-window'; $w.onReady(function () { }); export function pay_click() { createMyPayment({ items: [{ firstName: $w('#firstName').value, lastName: $w('#lastName').value, email: [$w('#email').value], phone: $w('#phone').value, name: $w('#name').value quantity: 1, }], amount: amount1 } ) .then( (payment) => { wixPay.startPayment(payment.id) .then( (result) => { if (result.status === "Successful") { } else if (result.status === "Failed") { // handle payment failure } else if (result.status === "Pending") { // handle payment pending } else if (result.status === "Cancelled") { // handle user closing payment panel } } ); } ); }
Wix-Pay API Help content media
0
7
538
chajj
Aug 08, 2018
In Coding with Velo
I have been trying to achieve this for the past week but I am on the verge of giving up! So in need of help PLEASE! Thank you I have a repeater on my page that I connected to a dataset by code. The container in the repeater has three elements: a text for the name, a text for an email, and a button. The email and the name texts come from the dataset. On the page, I have an empty user input element, a text box. I added a function button in the repeater so that every time I click on the corresponding button of a container in the repeater the email of that container gets added to the text box so I can send a mass email to all the recipients in that text box. I was successful in connecting the elements of the repeater to the dataset. And I was also semi-successful in adding the email address from the repeater to the text box by creating an onClick function that adds the email to the text box. BUT (and here where the problem is), it is only doing so for the FIRST container in the repeater whereby if you click any of the buttons in the repeater, the value of the text box will be equal to the value of the first email of the first container. I know this might be complicated, so THANK YOU in advance for any help or advice. import wixData from 'wix-data'; $w.onReady(function () { }); $w.onReady(function () { $w("#repeater1").onItemReady( ($w, itemData, index) => { $w("#text113").text = itemData.email; $w("#text111").text = itemData.givenName; $w("#text112").text = itemData.practiceAreas; } ); wixData.query("CommunityMembers") .find() .then( (results) => { $w("#repeater1").data = results.items; } ); } ); function emailCombine () { $w("#textBox1").value = $w("#text113").text; } export function button1_click(event, $w) { emailCombine (); }
1
14
8k
chajj
Jul 29, 2018
In Coding with Velo
I have a button on a dynamic item page that is collapsed. I want to expand that element if one of my dropdown's value = X However, the value of that dropdown is entered on a different page. Therefore, I cannot expand the button by adding an "onChange" nor an "onClick" event to the dropdown menu cause the value is already input. In other words, I want the collapsed button to expand onReady if the pre determined dropdown value is = X. Any help on this is much appreciated! Thank you!
0
3
123
chajj
Jun 09, 2018
In Coding with Velo
I have a dynamic page that displays information from form submissions (connected to dataset A). One of the input fields is "Name" I want to add a button to that page that redirects me to another Form (connected to dataset B) and at the same time transfer the value of the Name Field on Form A to the Name Field on Form B that is connected to dataset B.
0
2
445
chajj
Jun 07, 2018
In Coding with Velo
I have a database that contains Names, emails, phone numbers and other information. I have created a page that displays those information through a repeater and a table. However, I would like some advice on how I can select one "row" or one "repeater" that display one contact information so I can send an email. In other words, I am trying to create a table (or a repeater or...) where information from a database is displayed. One of those fields is an email. When clicking that box I would like it to retrieve the email address to be the recipient of my email. Hope I was clear in my explanation! Thank you!
0
4
167
chajj
May 22, 2018
In Coding with Velo
I have a multistage form on my website connected to a Dataset. Dataset Settings: Mode is Write only. The fields in the form (general settings) are NOT "read only". The database permissions are set so that all members can submit. I am encountering one weird problem. If I fill out the fields on the first slide, then click the button to continue to the second slide, the fields on the second slide are disabled. However, if you click to go back to the first slide, change the input of any field, then click on the second slide the fields are no longer disabled. One other problem I am encountering is that when i access the page, the stages (at the top of the form) of the form are all underlined when the code in the Wix example shows that the first slide - stage- should only be underlined when accessing the page that has the form on it. Thanks for the help! This is the link to the form: https://www.le-galhp.com/intake and the code on the page: function showContactInfo() { $w('#slideshow1').changeSlide(0); $w('#ContactInfo').disable(); $w('#Questionnaire').enable(); $w('#Agreement').enable(); $w('#Confirmation').enable(); $w('#ContactInfoLine').show(); $w('#QuestionnaireLine').hide(); $w('#AgreementLine').hide(); $w('#ConfirmationLine').hide(); } function showQuestionnaire() { $w('#slideshow1').changeSlide(1); $w('#ContactInfo').enable(); $w('#Questionnaire').disable(); $w('#Agreement').enable(); $w('#Confirmation').enable(); $w('#ContactInfoLine').hide(); $w('#QuestionnaireLine').show(); $w('#AgreementLine').hide(); $w('#ConfirmationLine').hide(); } function showAgreement() { $w('#slideshow1').changeSlide(2); $w('#ContactInfo').enable(); $w('#Questionnaire').enable(); $w('#Agreement').disable(); $w('#Confirmation').enable(); $w('#ContactInfoLine').hide(); $w('#QuestionnaireLine').hide(); $w('#AgreementLine').show(); $w('#ConfirmationLine').hide(); } function showConfirmation() { $w('#slideshow1').changeSlide(3); $w('#ContactInfo').enable(); $w('#Questionnaire').enable(); $w('#Agreement').enable(); $w('#Confirmation').disable(); $w('#ContactInfoLine').hide(); $w('#QuestionnaireLine').hide(); $w('#AgreementLine').hide(); $w('#ConfirmationLine').show(); } export function ContactInfo_onClick(event) { showContactInfo(); } export function Questionnaire_onClick(event) { showQuestionnaire(); } export function Agreement_onClick(event) { showAgreement(); } export function Confirmation_onClick(event) { showConfirmation(); } export function save1Button_onClick(event) { showQuestionnaire(); } export function questionnaireButton_click(event) { showAgreement(); } export function agreeButton_click(event) { showConfirmation(); }
2
10
360
chajj
May 16, 2018
In Coding with Velo
I have a page on my site that displays content from a dataset. That table is connected to a dynamic page that displays each item displayed in that table. However, I don't seem to able to find an article or a tutorial on wix that could help me create pagination for that index table. I have hundreds of entries to that dataset and would like to create a pagination for that table. Could someone please help me with that? thanks!
0
5
984

chajj

More actions
bottom of page