top of page

Forum Posts

jahir_salgado
Jun 09, 2023
In Coding with Velo
Hi, everyone 😁 Hope you all are doing fine I have some Dynamic Pages, what I'm looking for is to activate a "Next dynamic page" when the user scrolls down, or when the user presses the down arrow button ⬇️. And the same with going up, if the code detectes that the user scrolls up, the page will take you to the previous Dynamic page or pressing the up arrow button ⬆️ Is it there a way to activate these functions? Thank you so much for your time and answer! 😁
0
0
9
jahir_salgado
May 11, 2023
In Coding with Velo
Hello everyone, hoping you're doing fine! 😁 I just have a situation with dates. I want, by using code, to get the first day of the current month, and save it in a date input For example, this current month (when I'm publishing this) is May, so when the user gets in, a date input will automatically show: (1/5/2023 - INT or 5/1/2023 - USA, however you want to use it) It cannot be: a number or a text It must be in date format, so the date input can read and save that info with no problem Does anyone have an idea to this situation? Thank you so much for your time and answer!
0
2
33
jahir_salgado
Apr 21, 2023
In Coding with Velo
Hi, everyone Hoping you all are doing well 😁 I've got a repeater that is connected to different items, as you can see the containers have only three things: - The name of the item (it is connected to the database) - The image of it (it is connected to the database) - A free text (this is NOT connected to something) When I try to apply code to the "Free text" (as I said before, it is not connected to something) nothing happens Is it there a way to interact with the free text and change it using code? Obviously, the code will affect all the "Free text" from all the containers in that repeater Thank you so much for your time, and hope there's a way to achieve this 😁
Interact with container/repeaters content media
0
5
58
jahir_salgado
Feb 24, 2023
In Coding with Velo
Hi everyone, hoping you're doing well! 😁 Here's the case: I use the default settings to save info to a database (this data will be uploaded by a user). So then, I have a folio number that is calculated automatically, using code. I want that folio number to be saved at the same time and row when the user uploads the info. As you can see, when I use the default settings to save information and code to save the folio number (by apart), the information is saved, but in different rows How can I save or merge the information to have just a single row? Using both, default settings and code I will greatly appreciate your collaboration Thank you!
[SOLVED] Save information using default settings and code content media
0
4
71
jahir_salgado
Aug 29, 2022
In Coding with Velo
Hi everyone! I have my code where I recollect data from my input ($w('#input2')), it has to be a number. Here the issue is that, when it is submitted, the information that arrives to the database is a "text" format, and it does not read it as a "number" type (see my image, the last column named "Cantidad"). Does anyone has a solution or something for this? My code looks like this (I just pasted here the code part that interacts with my input $w('#input2')): import wixData from 'wix-data'; $w('#input2').required; $w("#input2").inputType = "number"; $w("#input2").onKeyPress(event => { setTimeout(() => {validateInput();}, 10) }) function validateInput(){ let value = $w("#input2").value; if (/[a-z]/.test(value.toLowerCase())){ $w("#input2").value = ""; } } export function button2_click(event) { $w('#input2').required; if ($w('#input2').value === ""){ $w('#Error').show(); $w('#message').hide(); $w('#input2').style.backgroundColor = "#C23B22"; console.error(); } if ($w('#input2').valid) { $w("#input2").inputType = "number"; $w('#message').show(); $w('#Error').hide(); let cantidad = $w('#input2').value let toInsert = { "cantidad": cantidad, }; wixData.insert("Entradas", toInsert) .then((results) => { console.log(results); }) $w('#input2').value = ""; $w('#input2').resetValidityIndication(); .catch((err) => { console.log(err); }); } } } } }
[SOLVED] Value saved as "text" instead of "number" type content media
0
2
31
jahir_salgado
Aug 26, 2022
In Coding with Velo
Hello everyone 😁 I'm using code for entering some data to a Database, it actually works well. The problem here is that, no matter what the inputs have (for example, text instead of numbers) or if they are empty (all inputs are required), if you click the "save" button the code will save ALL automatically All I want is to validate the data the user is entering, when the SaveButton is being clicked: To validate if they are not empty, all of them must be filled To validate their "type" (if the input requests numbers, it won't be saved if it is text) I want the inputs that were filled incorrectly or left empty to change to their Error Mode If there is any error, the code won't save the information and an Error Message will appear If everything is OK, a Success message will appear, then it saves the information and, finally, all the inputs delete the info they have and the counter ($w('#text13')) refreshes (a loop, in a nutshell) I just need your guide to know what (and where) I have to add in the code import wixData from 'wix-data'; $w.onReady(function () { wixData.query("Entradas") .count() .then ((result) => { $w('#text13').text = result.toString() }) }); export function button2_click(event) { const cant = $w('#input2').value const pre = $w('#input3').value var precio = cant * pre $w('#input4').value = precio.toString() let folio = $w('#text13').text let escuela = $w('#dropdown1').value let dulce = $w('#dropdown2').value let fecha = $w('#datePicker1').value let cantidad = $w('#input2').value let inversion = $w('#input4').value let s = "+" let si = "-" let toInsert = { "title": folio, "escuela": escuela, "dulce": dulce, "fecha": fecha, "s": s, "cantidad": cantidad, "si": si, "inver": inversion }; wixData.insert("Entradas", toInsert) .then((results) => { console.log(results); }) .catch((err) => { console.log(err); }); }
0
0
17
jahir_salgado
Jul 13, 2022
In Coding with Velo
Hello everyone 😁 I have some trouble displaying a date alert in my site. I have a date picker for my users (that works as a Expiry Date). This is an example of what I want: Someone will fill the data and will select a Expiry Date: February 5th 2023. So, what I want, is a pop-up alert (or whatever is easier to build u¡in the site, I just need something visual to remind the user) that shows on January 5th 2023 (one month before the Expiry Date arrives). Obviously you can close that alert with an X button. That alert won't stop appearing until the user updates the Expiry Date to a further one, maybe next year Does anyone has something for my case? I will thank you so much!
0
2
31

jahir_salgado

More actions
bottom of page