top of page

Forum Posts

Ben Smith
Mar 10, 2021
In Coding with Velo
Hello Everyone, So I have a dropdown change event that will populate a text box with a number and what number that will be is determined by the selection made by the drop down. I have done something similar to this, just stuck and don't know how to fix this. export function dropdown1_change(event) { let selectedIndex = $w("#dropdown1").selectedIndex; if (selectedIndex === 1){ $w("#text1").text =(100).toFixed(2).toString(); }if (selectedIndex === 2) { $w("#text1").text =(200).toFixed(2).toString(); }if (selectedIndex === 3) { $w("#text1").text =(300).toFixed(2).toString(); }if (selectedIndex === 4) { $w("#text1").text =(400).toFixed(2).toString(); }if (selectedIndex === 5) { $w("#text1").text =(500).toFixed(2).toString(); } } Any help would be greatly appreciated.
0
4
175
Ben Smith
Jan 26, 2021
In Coding with Velo
Good Afternoon Everyone, So I have a page where users submit information into a database. Is it possible to see their submission in preview mode , select it and delete it? I know in editor mode I can go to that database and delete the item manually. But can you delete items in preview mode using dropdowns, buttons, etc.. I have a search using dropdowns & buttons to select their submissions to view it, but it would be nice if I could delete it from the database from that page in preview mode. Thank you in advance!
0
1
18
Ben Smith
Dec 08, 2020
In Coding with Velo
Hello, Is there a code that would automatically total the value of text fields without any user interference. I have text1, text2, & text3 that will populate numbers. I want text4 to show the total. So if those 3 texts boxes show 0 then the total will be zero and will calculate as numbers are uploaded into those text boxes. Thank you in advance for any help.
0
13
90
Ben Smith
Dec 07, 2020
In Coding with Velo
Hello, Is it possible for a button or event to initiate two calculations that correspond with each other. Sorry if I am not explaining this well but I will give an example of a code that isn't working how I would like it to. export function button1_click(event) { $w("#text1").text = (text2*100).toFixed(2).toString(); $w("#text4").text = (text3*100).toFixed(2).toString(); $w('#text5').text = (text1+text4).toFixed(2).toString(); } So I want the calculations to be done for text1 and text4, then I would like the new totals of text1 and text4 to be shown in text5 after button1 is pressed. Currently text1 and text4 will show their totals but text5 will not show the totals of those two added together. I understand why this is not working how I would like it to but I'm sure there is some work around to make this possible. Or is it somehow possible for a text to always show a total of desired text boxes, similar to a sum function in excel. Thank you in advance for any help,
0
0
9
Ben Smith
Oct 26, 2020
In Coding with Velo
I know this has been a common question. But I am still trying to figure it out. I have buttons that perform calculations and the result will show in a text field. I simply want that text field to show as US currency, Right now it will show as "10000.00", I would like it to show as "$10,000.00" I will paste a snippet of some of my code (the calculations), any help will be greatly appreciated. $w("#text2").text = (dropdown5*dropdown6*text2).toFixed(2).toString(); $w("#text4").text = (dropdown5*dropdown6*text4).toFixed(2).toString(); Thank you in advance for any help.
0
3
52
Ben Smith
Aug 12, 2020
In Coding with Velo
I need an if statement that will cause a text field to equal another text fields value if a certain number is in a text field. So if Text1 is equal to "1" then Text2 will be the same a the value in Text3 I figured it would look something like this if (text1 === 1) { $w("#text2")===$w("#text3"); } Is this possible, I am new to Corvid. So any help will be greatly appreciated. Thank you
0
2
47
Ben Smith
Jul 30, 2020
In Coding with Velo
Hello Everyone, I have input fields on my form where a user inputs a number. Is there a way to disable/get ride of those numeric arrow keys on the right hand side of the input field? The arrow keys act as a dial to increase or decrease by one whole number, I don't really need this on my form. Hopefully there is a simple solution! Thank you!
0
2
230
Ben Smith
Jul 20, 2020
In Coding with Velo
Hello Everyone, I simply what a drop downs selection to hide or show an input field. My code almost works, for some reason if i select either of the two drop selections it will hide the input field, and also wont show it if I change the selection . Any help would be greatly appreciated. export function dropdown3_change() { if ($w("#dropdown3").value === 1){ $w("#input1").show(); } else ($w("#dropdown3").value ===0) $w("#input1").hide(); } Thank you!
0
8
770
Ben Smith
Jul 17, 2020
In Coding with Velo
Hello Everyone, I simply want a drop downs selection to enable or disable an input field. There are only two selections and one has the value of 1 and the other has the value of 0. Here is my code below, I know I am close but it is not working yet. Any help would be greatly appreciated. export function dropdown3_change(){ if ($w("#dropdown3").value === 1){ $w("#input1").enable(); } else { $w("#input1").disable(); } } Thank you!
0
4
67
Ben Smith
Jun 23, 2020
In Coding with Velo
Hello, My search filters by drop downs and a search button to initiate the search, two of the drop downs are multipliers to the results. During the search maybe less than 2 seconds. The texts boxes in which the results are shown will flicker/shuffle through the results, and finally show the correct result. Is there a way for me skip that shuffle and flicker so after the button is initiated it only shows the correct result. Not really sure what needs to be added to my code. Any help would be greatly appreciated. import wixData from 'wix-data'; $w.onReady(function () { }); export function button1_click(event, $w) { let generalFilter = wixData.filter() .eq("Size", $w('#dropdown1').value) .contains("Height", $w('#dropdown2').value) .contains("Weight", $w('#dropdown3').value); let RedFilter = generalFilter.eq("Color", "Red"); let BlueFilter = generalFilter.eq("Color", "Blue"); Promise.all( [$w('#dataset1').setFilter(RedFilter), $w('#dataset2').setFilter(BlueFilter)] ) .then(() =>{ $w('#text1').expand(); $w('#text2').expand(); let dropdown4 = Number($w("#dropdown4").value); let dropdown5 = Number($w("#dropdown5").value); let text1 = Number ($w("#text1").text); let text2 = Number ($w("#text2").text); $w("#text1").text = (dropdown4*dropdown5*text1).toFixed(2).toString(); $w("#text2").text = (dropdown4*dropdown5*text2).toFixed(2).toString(); }) } Thank you,
0
2
219
Ben Smith
Jun 03, 2020
In Coding with Velo
Hello, I need a user form where a person can input a percentage then submit it to a data set. But it needs to be recognized as a percentage for future calculations to be done. Having the input and connected field set to text or number does not work. Is this possible? Any help or suggestions will be greatly appreciated. Thank you!
0
2
107
Ben Smith
May 22, 2020
In Coding with Velo
Hello, I hope what I am looking for has a easy solution. So I have Drop downs that act as a filter and will display a cost in a text field. The text field currently shows as 1922.30103757865. I want to format that text field to show as rounded and in US dollars, so $1,922.30. The cost in data set reads as it is currently show in the text field. Any help would be greatly appreciated! Thank you!
0
1
323
Ben Smith
May 18, 2020
In Coding with Velo
Hello, the code below works. I will filter by drop down and the results will show in the text fields (fields 2,4, and 6). But when I try adding the 4th data set and the text field for the the results to show, it will not filter and will just stay blank. The other 3 text fields will filter and display with no problem. I seem to run into trouble when I add that 4th data set and 4th text field to be filtered. The text in green is what I added, but wont filter and display results. Other 3 work fine (Red, Blue, Yellow), not sure what the problem is. import wixData from 'wix-data'; $w.onReady(function () { }); export function button1_click(event, $w) { let generalFilter = wixData.filter() .eq("size", $w('#dropdown1').value) .contains("weight", $w('#dropdown2').value) .contains("height", $w('#dropdown3').value) let RedFilter = generalFilter.eq("color", "Red"); let BlueFilter = generalFilter.eq("color", "Blue"); let YellowFilter = generalFilter.eq("color", "Yellow"); let OrangeFilter = generalFilter.eq("color", "Orange"); // This line was added but wont filter like the others Promise.all( [$w('#dataset1').setFilter(RedFilter)] [$w('#dataset2').setFilter(BlueFilter)] [$w('#dataset3').setFilter(YellowFilter)] [$w('#dataset4').setFilter(OrangeFilter)] // This line was added but wont filter like the others ) .then(() =>{ $w('#text2').expand(); $w('#text4').expand(); $w('#text6').expand(); $w('#text8').expand(); // This line was added but wont filter like the others }) } Thank you for your help!
0
2
27
Ben Smith
May 15, 2020
In Coding with Velo
Is there a maximum amount of datasets that can be connected to a page?
0
1
99
Ben Smith
May 15, 2020
In Coding with Velo
I have a repeater that displays data (cost) after users use drop downs to search/filter through my data set. Is it possible to have another drop down that would act as a multiplier to that cost shown in the repeater. If so what do I need to add to this code below. Current Code that searches/filters. import wixData from 'wix-data'; $w.onReady(function () { }); export async function button1_click(event, $w) { $w('#dataset1').setFilter(wixData.filter() .eq("sex", $w('#dropdown1').value) .contains("age", $w('#dropdown2').value) .contains("ethnicity", $w('#dropdown3').value) .contains("service", $w('#dropdown4').value) ) .then(() => { console.log("Dataset is now filtered"); }) .catch((err) => { console.log(err); }); $w('#table2').expand(); }
0
2
38
Ben Smith
May 14, 2020
In Coding with Velo
The code I have below filters out the item number for the color red items. The filter Is by size, weight, and height. The results for red are shown in a "text1". In my database the values are Item Number, Size, Weight, Height, and color. (This code works) import wixData from 'wix-data'; $w.onReady(function () { }); export function button1_click(event, $w) { $w('#dataset1').setFilter(wixData.filter() .eq("color", "red") .eq("size", $w('#dropdown1').value) .contains("weight", $w('#dropdown2').value) .contains("height", $w('#dropdown3').value) ) $w('#text1').expand(); } (Currently) What I would like to do is add another text field where the green colored item numbers are shown when the drop downs are selected and the button is initiated. So after a user selects the drop downs size,weight, and height. The item number will show for red in a "text1" but also show for green in "text2". What do I need to add to my code for the green colored results to be shown? (What I would like it to be) Any help will be greatly appreciated!
Showing Multiple Filtered Results in Text Fields content media
0
2
40
Ben Smith
May 12, 2020
In Coding with Velo
Hello I am new to Corvid. What i would like to do is have a drop down that filters only a desired fields in a column. For example have a drop down that filters size, weight, and height. I also have another column labeled color. I would only like the drop down to filter a certain color in that "Color" column and present it in a text box/field. The code below filters through the Size, Weight, and Height column. I would only like to filter the red color in the Colors Column. So the results for only red are shown. I do not want to add a Colors drop down, to select red. I want red already to be selected for the drop downs to start filtering. import wixData from 'wix-data'; $w.onReady(function () { }); export async function button1_click(event) { $w('#dataset1').setFilter(wixData.filter() .eq("size", $w('#dropdown1').value) .contains("weight", $w('#dropdown2').value) .contains("height", $w('#dropdown3').value) ).... Any help would be really appreciated! Thank you!
0
16
72
Ben Smith
May 01, 2020
In Coding with Velo
Hello, I am new to writing code in Corvid. I currently have 4 drop downs that search through a collection and show the cost in a repeater. What I would like to do is add a drop down and if selected and then searched that new drop down selection is linked to a multiplier. Which will multiply that cost and show it in the repeater. This is my current code that works great. Just don't know where to start to add that 5th drop down that is linked to a multiplier. import wixData from 'wix-data'; $w.onReady(function () { }); export async function button1_click(event, $w) { $w('#dataset1').setFilter(wixData.filter() .eq("sex", $w('#dropdown1').value) .contains("age", $w('#dropdown2').value) .contains("size", $w('#dropdown3').value) .contains("weight", $w('#dropdown4').value) ) .then(() => { console.log("Dataset is now filtered"); }) .catch((err) => { console.log(err); }); $w('#table2').expand(); } Any help would be greatly appreciated. Thank you
0
0
29

Ben Smith

More actions
bottom of page