top of page

Forum Posts

Hugh Harvey
Mar 23, 2019
In Coding with Velo
Hi guys Below is a bit of code I have done within a repeater, but it returns NaN (Not a number). Can anybody see what I am doing wrong? Thanks :-) export function button1_click(event, $w) { wixData.query('offers') .eq("avail", "Y") .contains('airport', $w('#airportselect').value) .contains('duration', "Daybreak") .ascending("date") .limit(100) .find() .then(res => { $w('#repeater1').data = res.items; $w('#repeater1').expand(); $w('#repeater1').show(); let adultPrice = res.items.adult; let childPrice = res.items.child; let adultCount = $w('#adultselect').value; let childCount = $w('#childselect').value; let totalPrice = ('adultPrice'*'adultCount') + ('childPrice'*'childCount'); $w('#totalPrice').text = "£" + totalPrice.toString(); }); }
0
1
461
Hugh Harvey
Nov 01, 2018
In Coding with Velo
Dear Wix People I have a database which in a column lists a price for an "adult" and in another column a price for a "child". I want to use a User Input box so client can choose No. of Adults | No. of Children. Then I want a "Total Cost" to be listed in a Repeater. Is there a tutorial? Any Ideas? Thanks Hugh
0
1
368
Hugh Harvey
Aug 13, 2018
In Coding with Velo
Hi All I have a page with 4 dropdown boxes and a Search Button producing results in a Repeater: The order is (with onChange names below): #dropdownName4 - #dropdownName1 - #dropdownName2 - #dropdownName3 (season_change) (airport_change) (duration_change) When someone selects 4 - 1 - 2 - 3 everything is cool. But then when they go back and start changing fields the problems happen. Basically, I want when someone changes "#dropdownName4", that the dropdowns after revert to placeholder text. So that they must be reselected. My onChange code for season_change (#dropdownName4) starts: ===================================== export function season_change(event, $w) { uniqueDropDown1(); $w("#dropdownName1").enable(); } ===================================== Can someone tell me the little bit of code to make sure that the newxt field (#dropdownName1) reverts to Placeholder Text. Many thanks in advance!! Regards Hugh
0
3
426
Hugh Harvey
Jul 03, 2018
In Coding with Velo
I have already set-up a dynamic page and used fields from various different Datsets to create the information contained on the page. Now I am looking at building a single Search content page using either a table or repeaters (or both). However, the reference fields do appear for selection, but do not appear in the results. Also, when using image in a reference field the preview mode shows the error " Wix code SDK error: The "src" property cannot be set to "". It must be a valid URL starting with "http://", "https://", or "image://". Anybody know why?
Reference fields in tables or repeaters content media
0
3
274
Hugh Harvey
Jul 02, 2018
In Coding with Velo
I have made a page containing repeaters. They look like a great idea. When I link the text & pics to the fields in my dataset. The fields that are in the main dataset are fine, however, the relational fields from other databases are blank. What am I doing wrong? Please :-(
0
3
56
Hugh Harvey
Jun 30, 2018
In Coding with Velo
Hey Guys & Gals, I have a table (#datestable) and OnRowSelect I want to link to the generated URL field which is called Offers (Title) (Field Key is link-offers-table). If I click OnRowSelect what do I put in code?? export function datestable_rowSelect(event, $w) { //Add your code for this event here: } Or is this the wrong way to do it?
0
1
80
Hugh Harvey
Jun 21, 2018
In Coding with Velo
Hi guys & gals. I have created a dynamic page for holidays which works perfectly well with information collated from a few databases. I now have a contact form on the dynamic page with user input fields completed by the client. So basically, the client can Submit his details (Name, Telephone etc.). I even have an email alert set up. The problem is I have no idea what he/she was looking at!! How do I include the dynamically created content from the page he was on into the Submit Form?
1
1
1k
Hugh Harvey
Jun 11, 2018
In Coding with Velo
Pulling my hair out with this. Please help: I have a page as such: Basically, I want to take the User Input "adultselect" and multiply it with the database field "adultFrom" and then add User Input "childselect" multiplied with the database field "childFrom". The Sum total would then be displayed in field "totalCost" which is blank in the database. My current onClick code is: export function searchButton_onClick(event) { wixData.query('TopSanta') .contains('airport', $w('#airportselect').value) .eq("dayb", "Y") .ascending("airport", "date", "duration") .limit(100) .find() .then(res => { $w('#table1').rows = res.items; $w('#table1').show(); }); } Can anybody help with the code to be added to make this happen?? Please. :-(
User Input with Database Calculation content media
0
1
326
Hugh Harvey
Nov 30, 2017
In Coding with Velo
Dear Wix Code Maestros I have a dataset (TopSanta) that contains 100's of rows of holiday information. Within the dataset I have a column for a Family of 3 price (fam3), a Family of 4 price (fam4) and a Family of 5 price (fam5). I want people to be able to display the information in a table (Table4) based on 2 selection they make from a drop down user input. 1st the airport they want (#selection1) & 2nd their family size (#selection2). Can anybody advise how I change the column I display depending on the family size selected?
0
1
345
Hugh Harvey
Oct 26, 2017
In Coding with Velo
I have the importing into a collection working like a treat. Thanks guys. But the thing I need to get sorted is the deleting of all records from a collection. I keep getting code errors. Can somebody give me the exact code for doing this? Let's say I have a page with an Input Box (#collectionInput) for loading the name of the collection I want to delete all records from. The only other things is a Button (#deleteButton) which when pressed wipes the collection of all records. Is this possible? Do I need to add anything else to the page? Any chance of listing the code to be added for this to work?
1
2
998
Hugh Harvey
Oct 16, 2017
In Coding with Velo
Been playing around with code on and off for a few weeks now. It is great and I have managed to do a few things that I needed for my site. A few questions on database collections: i) Is there a way of deleting an unused collection and removing from my site structure? ii) Is there a way of wiping all records from a collection before I do a fresh bulk submission? (I managed to get the bulk submission working - yeah) iii) Recently got the bulk submission working, but one of my fields contains a number which I use for filtering results. I want this field to be text, but after submission the database has a red line under each field with a comment saying " Cell value type is Number. Change to Text. " When I try to filter with changing to text it doesn't work. When I Change to Text it does. The column itself is marked as TEXT. Any ideas?
0
1
81
Hugh Harvey
Oct 11, 2017
In Coding with Velo
Just ready my "Coming Soon" Wix Code update. Anybody any ideas when CSV data input will become available? It is exactly what I need for my databases as all information is held offline in Excel.
0
5
616
Hugh Harvey
Oct 03, 2017
In Coding with Velo
Hey guys & gals. Thanks to you lot I have a search on my web-site using 2 pull-down boxes to then filter the results to meet the clients needs by selection. My original database display has filters put in, but not needed to be by code. But the Search Button code needs filters added again. I list my code below and would like to add a filter into the displayed records. Basically I have a field named "avail" which contains "Y" or BLANK. I only want to list ones that say "Y". Current code: ====================================== import wixData from 'wix-data'; //For full API documentation, including code examples visit http://wix.to/94BuAAs $w.onReady(function () { //TODO: import wixData from 'wix-data'; }); export function searchButton_onClick(event) { wixData.query('TopSanta') .contains('airport', $w('#selection1').value) .contains('duration', $w('#selection2').value) .ascending("airport", "date", "duration") .limit(100) .find() .then(res => { $w('#table1').rows = res.items; $w('#table1').show(); }); } ====================================== ONCE AGAIN THANKS ALL YOU GUYS!! :-)
0
2
92
Hugh Harvey
Oct 01, 2017
In Coding with Velo
Thanks to the good people on here I am so close to what I want my table to do. So thanks guys. 2 quick questions: 1) On the drop down list box I am using to search my table is there a value I can put for ALL (show all records)? 2) In the event that there are no records to show is there a bit of code to add "No records to show"? Once again guys thanks for all your help.
0
2
143
Hugh Harvey
Oct 01, 2017
In Coding with Velo
I have a table containing 100's of records but want it hidden on load but displayed only once a search is done from a pull down box of selection. I assume the table is marked 'Hidden on Load'. But that could be were I am going wrong. If that is TRUE the code for the Button search is below. I tried SHOW, but the table didn't show. Must have put it in wrong place. Anyone advise? ============================================================== $w.onReady(function () { //TODO: import wixData from 'wix-data'; }); export function searchButton_onClick(event) { wixData.query('TopSanta') .contains('airport', $w('#selection1').value) .ascending("airport", "date", "duration") .find() .then(res => { $w('#table1').rows = res.items; }); } export function button1_click(event) { //Add your code for this event here: } ==============================================================
0
2
435
Hugh Harvey
Sep 30, 2017
In Coding with Velo
Thanks to the wonderful Ixchel Nayeli Gomez I have managed to add a Search box to my page meaning that a table showing 100's of records can be filtered down by the Users input. The only problem is that when the new results display they lose the Sort I had added into my data-set. Basically, they now display by newest record first. Can someone advise the code to add so the after the search I can restore my sort order. Sort fields used are: Airport, Date & Duration. :-)
1
2
283

Hugh Harvey

More actions
bottom of page