top of page

Forum Posts

Brett Franklin
Mar 28, 2019
In Coding with Velo
Up until this morning everything was working fine. Now it is not. I had a few text elements connected to my Private Members Database (provided by Wix). The elements would be connected without a filter and would display the information pertaining to the current user. Now the db seems to be acting like a regular collection because the latest site member to sign up has their information displayed. Why did it change? If this was an update please change it back and if not please help me code this. How can I display the users current email, Full name, and other elements from the db?
0
3
1k
Brett Franklin
Mar 12, 2019
In Coding with Velo
I have a dataset that I would like to be filtered by Company. So, every user who has the same company will have access to the same information entered.
0
0
25
Brett Franklin
Mar 01, 2019
In Coding with Velo
How would I go about creating a custom notification system for my site members? I can picture the notification system being connected to a database. Certain actions on the site like forms being completed, announcements/updates, etc. would be in the notification center. How would I do this so that users see their own notifications? Right now I have a database that have very general notifications as all the site members can see them. Would I filter the dataset by Owner? If yes, then how would could I include notifications that go out to everyone? Open to all ideas.
0
0
130
Brett Franklin
Feb 23, 2019
In Coding with Velo
I have a form that gives users the ability to submit an image. I want them to see a preview of the image they uploaded in certain dimensions before they submit the entire form. How is this possible?
3
9
1k
Brett Franklin
Jan 29, 2019
In Coding with Velo
I have a repeater and a dropdown connected to the same database. The repeater shows one item from the database. I would like to have the dropdown be able to select a specific item from the database and have it shown in the repeater. Right now the dropdown is connected to the database and is populated with what I want. Next, I need to figure out a way to have the repeater change items being displayed when the user selects different items from the dropdown. I've looked at so many articles/videos and have not found what I need. Anyone know what to do?
1
9
123
Brett Franklin
Jan 09, 2019
In Coding with Velo
I have a form that has a date picker. I would like to send an email a day before the selected date in the form. How can I do that? I understand how to do the automation/triggered emails, but how can I set the time the email goes out a day before whatever was selected in the date picker?
1
1
135
Brett Franklin
Dec 16, 2018
In Coding with Velo
I have a form where users upload an image and the image is then displayed as a preview beside the upload button before the form is submitted. The image sometimes gets uploaded and sometimes doesn't. It seems like it only works for certain images... Here's the code: $w('#uploadButton1').onChange(() => { if ($w("#uploadButton1").value.length > 0) { $w("#uploadButton1").startUpload() .then((uploadedFile) => { $w("#full").src = uploadedFile.url; $w("#half").src = uploadedFile.url; $w("#quater").src = uploadedFile.url; $w('#image20').src = uploadedFile.url; $w('#image30').src = uploadedFile.url; $w('#vectorImage21').hide(); $w('#vectorImage22').hide(); $w('#fail').hide(); $w('#submit').enable(); calc(); }) .catch((uploadError) => { console.log(`Error: ${uploadError.errorCode}`); console.log(uploadError.errorDescription); }); } }); });
2
12
252
Brett Franklin
Dec 16, 2018
In Coding with Velo
I would like to align my html text to be right justified. The font size works, but not the text align. I would also ideally like to change the font type to Basic instead of the default too. Here's the code: $w('#calculate').html = `<span style='font-size: 14px'><span style='text-align: right'>$${price}.00</span>` #html #span #textalign
2
8
916
Brett Franklin
Dec 14, 2018
In Coding with Velo
For some reason my data hooks stopped working. I am not sure why. Basically, I have a form with a slideshow that changes based on the "Ad Size" selected in a Radio Group. In order for the slideshow to move when the Radio Group is selected, the values need to go in order like: 1, 2, 3, and 4 (I have four slides on this form). When the user submits the form I need the 1, 2, 3 and 4 to be converted to 9.5" x 12.5", 9.5" x 6.25", 4.75" x 6", and 4.75" x 3", respectively. I have one more form that submits to the same dataset and is similar to the first form, but the Radio Group determines something else. So, the values don't have to be 1, 2, 3, and 4. The last form I have is most similar to the first form, but submits to another dataset, but I think that once I find the solution I will be able to figure this form out on my own. Please offer any advice you have. Link to my editor is here: https://editor.wix.com/html/editor/web/renderer/edit/4ff19054-25d2-487c-af5d-a3cf4c12204d?metaSiteId=022bb531-d4e5-46ba-a83b-1c4293a4a2d3&editorSessionId=4b4b337a-057c-4d59-9db6-383b377d07f5&referralInfo=my-account Here's the code for the hook (in the backend): import wixData from 'wix-data'; export function Orders_beforeInsert(item, context) { //TODO: write your code here... //print ad size let hookContext = context; if (item.adSize === '1') { item.adSize = '9.5" x 12.5"' } else if (item.adSize === '2') { item.adSize = '9.5" x 6.25"' } else if (item.adSize === '3') { item.adSize = '4.75" x 6"' } else if (item.adSize === '4') { item.adSize = '4.75" x 3"' } else if (item.adSize === '1.1') { item.adSize = '5.5" x 8.5"' } else if (item.adSize === '2.1') { item.adSize = '7" x 9.25"' } else if (item.adSize === '3.1') { item.adSize = '8.5" x 11"' } return item; }
1
1
78
Brett Franklin
Dec 05, 2018
In Coding with Velo
In my custom registration form, how do I have members be able to update information about their street, city, state, country and zip code? I know with phone it‘s: "phones": [$w("#phone").value] The API reference doesn’t include info on what I mentioned before.
1
6
369
Brett Franklin
Sep 28, 2018
In Coding with Velo
I’m trying to give users the ability to select a title they would like to see from a database. I have the dropdown connected, but how do connect the rest of The page so the Other elements correspond with the selected item?
1
0
28
Brett Franklin
Sep 27, 2018
In Coding with Velo
How would I be able to set up and input field that would act as a discount field? I already have the calculation part done, but need to figure out how get an input to act as a promo Code area.
1
18
625
Brett Franklin
Sep 23, 2018
In Coding with Velo
How would I disable today's date in a date picker? I found this article, but it doesn't tell me about the current date. https://www.wix.com/code/reference/$w.DatePicker.html
2
2
905
Brett Franklin
Sep 19, 2018
In Coding with Velo
I have multiple newsletter list for my site. The users have the option to join all or specific ones, or just one based on if they check a box. How would I be able to automatically add this in wix code so that certain contacts are added to the checked off newsletters? Also would these lists be connected in MailChimp if I already have MailChimp connected?
1
1
47
Brett Franklin
Sep 13, 2018
In Coding with Velo
I am trying to connect a form so that users can see their responses for complete entries and see their drafts for incompleted entries And edit them.
2
1
173
Brett Franklin
Sep 07, 2018
In Coding with Velo
How would I get a lightbox to close on a countdown, and also show the countdown in the top corner of the lightbox? Thank you!
1
0
50
Brett Franklin
Aug 31, 2018
In Coding with Velo
Essentially, this page is an area where advertisers can purchase a print ad in multiple issues of the year. I have most of the coding part figured out (with help from Salman), but now I've found myself in a dead end. I'm not sure if this is a coding problem or a problem solving issue or even both. The problem is that if the user were to change their "ad size" or "ad color," then the calculation won't respond. I would like the calculation to be adjusted appropriately. Note: the calculation only appears once an image is uploaded. Also, how would I go about changing the font of the calculation area from "Arial" to "Basic" and instead of "This ad will run on 1 days" change to "This ad will run on [each date selected]." (Ex: This ad will run on Aug. 31, 2018, Sept. 1, 2018, Sept. 2, 2018.) All help is welcome and appreciated!!! Here is a link to the page (please do not submit the form): https://brettfranklin2.wixsite.com/website-2/print-ad Here is my code: // For full API documentation, including code examples, visit http://wix.to/94BuAAs import wixData from 'wix-data'; var till, price, pricesize, priceeffect, pricetime, start, end, pricew1, pricew2, pricew3, pricew4, pricew5, pricew6, pricew7, pricew8, pricew9, pricew10, pricechange, cost, total; price = pricew1 = pricew2 = pricew3 = pricew4 = pricew5 = pricew6 = pricew7 = pricew8 = pricew9 = pricew10 = 0; till = 1; pricesize = 0; priceeffect = 0; pricetime = 1; pricechange = 0; cost = 0; total = 0; // var d = new Date() // var endDate = new Date("2018-12-31") // console.log(d.getMonth(), d, endDate) // arr = new Array(); $w.onReady(function () { // Gets today's date const today = new Date(); const options = { day: "numeric", month: "long", year: "numeric" }; // Sets the property of the text element to be a string representing today's date in US English $w("#text194").text = today.toLocaleDateString("en-US", options); $w("#text193").text = today.toLocaleDateString("en-US", options); $w("#date1").text = today.toLocaleDateString("en-US", options); $w("#text192").text = today.toLocaleDateString("en-US", options); //$w('#datePicker1').disabledDates = [0,1,2,3,4,5,6] $w('#dataset1').onReady(() => { // ------------------KEEP THIS CODE FOR ----------------------// /*$w('#datePicker1').disabledDates = [] wixData.query("PublicationDates") //.not("issue") .find() .then((res) => { // console.log(res.items[0].issue, "DB"); // issue = res.items[0].issue var dbDates = [] while (d <= endDate) { arr.push(new Date(d)); C = arr.filter(function (val) { return dbDates.indexOf(val) === -1; }); d.setDate(d.getDate() + 1); } for (let i= 0; i < res.length; i++) { let dbD = res.items[i].issue dbDates.push(dbD) } //let C = arr.filter(a => !dbDates.includes(a)); console.log(arr, dbDates, C) }) // $w('#datePicker1').disabledDaysOfWeek = [0,1,2,3,4,5,6]*/ weeks() }) 1 $w('#radioGroup1').onChange(() => { let slide = $w('#radioGroup1').value; $w('#slideshow1').changeSlide(Number(slide) - 1) if ($w('#radioGroup1').value === '1') { pricesize = 800; //pricechange = pricesize-800; $w('#checkbox01').checked = false; $w('#checkbox1').checked = false; $w('#checkbox2').checked = false; $w('#checkbox3').checked = false; $w('#checkbox4').checked = false; $w('#checkbox8').checked = false; $w('#checkbox7').checked = false; $w('#checkbox6').checked = false; $w('#checkbox5').checked = false; $w('#checkbox16').checked = false; $w('#checkbox15').checked = false; console.log(pricesize, 'price size') } else if ($w('#radioGroup1').value === '2') { pricesize = 400; //pricechange = pricesize-400; $w('#checkbox01').checked = false; $w('#checkbox1').checked = false; $w('#checkbox2').checked = false; $w('#checkbox3').checked = false; $w('#checkbox4').checked = false; $w('#checkbox8').checked = false; $w('#checkbox7').checked = false; $w('#checkbox6').checked = false; $w('#checkbox5').checked = false; $w('#checkbox16').checked = false; $w('#checkbox15').checked = false; console.log(pricesize, 'price size') } else if ($w('#radioGroup1').value === '3') { pricesize = 200; //pricechange = pricesize-200; $w('#checkbox01').checked = false; $w('#checkbox1').checked = false; $w('#checkbox2').checked = false; $w('#checkbox3').checked = false; $w('#checkbox4').checked = false; $w('#checkbox8').checked = false; $w('#checkbox7').checked = false; $w('#checkbox6').checked = false; $w('#checkbox5').checked = false; $w('#checkbox16').checked = false; $w('#checkbox15').checked = false; console.log(pricesize, 'price size') } else if ($w('#radioGroup1').value === '4') { pricesize = 100; //pricechange = pricesize-100; $w('#checkbox01').checked = false; $w('#checkbox1').checked = false; $w('#checkbox2').checked = false; $w('#checkbox3').checked = false; $w('#checkbox4').checked = false; $w('#checkbox8').checked = false; $w('#checkbox7').checked = false; $w('#checkbox6').checked = false; $w('#checkbox5').checked = false; $w('#checkbox16').checked = false; $w('#checkbox15').checked = false; console.log(pricesize, 'price size') } else { pricesize = 0; $w('#checkbox01').checked = false; $w('#checkbox1').checked = false; $w('#checkbox2').checked = false; $w('#checkbox3').checked = false; $w('#checkbox4').checked = false; $w('#checkbox8').checked = false; $w('#checkbox7').checked = false; $w('#checkbox6').checked = false; $w('#checkbox5').checked = false; $w('#checkbox16').checked = false; $w('#checkbox15').checked = false; console.log(pricesize, 'price size') } calc(); }) $w('#uploadButton1').onChange(() => { if ($w("#uploadButton1").value.length > 0) { $w("#uploadButton1").startUpload() .then((uploadedFile) => { $w("#full").src = uploadedFile.url; $w("#half").src = uploadedFile.url; $w("#quater").src = uploadedFile.url; $w("#eight").src = uploadedFile.url; $w('#calculate').show(); $w('#submit').enable(); calc(); }) .catch((uploadError) => { console.log(`Error: ${uploadError.errorCode}`); console.log(uploadError.errorDescription); }); } }); /*$w('#month1').onChange(() => { let month1 = $w('#month1').value console.log(month1); /* wixData.query("PublicationDates") .eq("issue", ) .find() .then((res) => { console.log(res, res.items[0]) let dates = res.items[0].issue.getDate(); let months = res.items[0].issue.getMonth(); console.log(dates, months) })*/ }) //}); export function checkbox1_change(event, $w) { if ($w('#checkbox1').checked) { //$w('#fulbox').hide(); //$w('#halfbox').hide(); //$w('#quatebox').hide(); //$w('#eighbox').hide(); priceeffect = 275; } else { //$w('#fulbox').show(); //$w('#halfbox').show(); //$w('#quatebox').show(); //$w('#eighbox').show(); priceeffect = 0; } calc() } function weeks() { console.log('tillfn called') $w('#checkbox01').onChange(() =>{ if($w('#checkbox01').checked) { pricew1 = pricesize + priceeffect } else { pricew1 = 0 } calc() }) $w('#checkbox2').onChange(() =>{ if($w('#checkbox2').checked) { pricew2 = pricesize + priceeffect } else { pricew2 = 0 } calc() }) $w('#checkbox3').onChange(() =>{ if($w('#checkbox3').checked) { pricew3 = pricesize + priceeffect } else { pricew3 = 0 } calc() }) $w('#checkbox4').onChange(() =>{ if($w('#checkbox4').checked) { pricew4 = pricesize + priceeffect } else { pricew4 = 0 } calc() }) $w('#checkbox8').onChange(() =>{ if($w('#checkbox8').checked) { pricew5 = pricesize + priceeffect } else { pricew5 = 0 } calc() }) $w('#checkbox7').onChange(() =>{ if($w('#checkbox7').checked) { pricew6 = pricesize + priceeffect } else { pricew6 = 0 } calc() }) $w('#checkbox6').onChange(() =>{ if($w('#checkbox6').checked) { pricew7 = pricesize + priceeffect } else { pricew7 = 0 } calc() }) $w('#checkbox5').onChange(() =>{ if($w('#checkbox5').checked) { pricew8 = pricesize + priceeffect } else { pricew8 = 0 } calc() }) $w('#checkbox16').onChange(() =>{ if($w('#checkbox16').checked) { pricew9 = pricesize + priceeffect } else { pricew9 = 0 } calc() }) $w('#checkbox15').onChange(() =>{ if($w('#checkbox15').checked) { pricew10 = pricesize + priceeffect } else { pricew10 = 0 } calc() }) } function calc() { //You will spend a total of $42.00. This ad will run for 14 days ending on Jul 28, 2018. price = pricew1 + pricew2 + pricew3 + pricew4 + pricew5 + pricew6 + pricew7 + pricew8 + pricew9 + pricew10 console.log("(" + pricesize, "+", priceeffect, "+", pricechange,') * ', till) $w('#calculate').html = `<span style='font-size: 16px'> You will spend a total of <span style="font-size: 16px"> $${price}</span>. This ad will run on <span style="font-size: 16px">${till} days. </span> </span> ` } export function box3_mouseIn(event, $w) { //Add your code for this event here: $w('#text195').show(); $w('#vectorImage2').show(); $w('#vectorImage3').show(); } export function box3_mouseOut(event, $w) { //Add your code for this event here: $w('#text195').hide(); $w('#vectorImage3').hide(); $w('#vectorImage2').hide(); } export function box10_mouseIn(event, $w) { //Add your code for this event here: $w('#vectorImage6').show(); $w('#vectorImage7').show(); $w('#text203').show(); } export function box10_mouseOut(event, $w) { //Add your code for this event here: $w('#vectorImage6').hide(); $w('#vectorImage7').hide(); $w('#text203').hide(); }
1
1
144
Brett Franklin
Aug 19, 2018
In Coding with Velo
Is it possible, through Wix Code, to have a lightbox open when the user leaves a page? Essentially, I want the lightbox to say if the user wants to save the form as a draft or discard the draft and then continue to where the user clicked.
1
1
188
Brett Franklin
Aug 19, 2018
In Coding with Velo
Is there any way you can use Wix Code to prevent duplicate contacts (same email) for my custom registration page?
1
9
2k
Brett Franklin
Aug 18, 2018
In Coding with Velo
My code for the custom registration was working fine, but I wanted to redirect the user to their account page in the Member's App using the wixLocation API. I am getting an unexpected token error on my third to last curly bracket/semicolon/parentheses. Please suggest a solution! TIA import wixUsers from 'wix-users'; import wixLocation from 'wix-location'; $w.onReady(function () { $w('#submit').onClick( () => { // register as member using form data wixUsers.register($w('#email').value, $w('#password').value,{ "contactInfo": { "firstName": $w('#firstname').value, "lastName": $w('#lastname').value, "emails": [$w('#email').value], // "phone": ($w('#phone').value), "position": ($w('#jobtitle').value), "company": ($w('#company').value), "industry": ($w('#industry').value), "employees": ($w('#employees').value), "street": ($w('#street').value), "city": ($w('#city').value), "zip": ($w('#zip').value), "state": ($w('#state').value) .then(()=>{ wixLocation.to('/account/my-account'); } }); }); });
1
10
379

Brett Franklin

More actions
bottom of page