Hi !
So my issue is that my links are built with the name of the item, and if certain symbols are present in the title, they make a mess and lead to a 404. (such as %, &, +).
Example (click, then refresh and it will lead to a 404) : https://www.wehaveadeal.net/deals/TV-Philips-50PUS7555%2F12-(50%22%2C-LED%2C-4K-UHD%2C-HDR-10%2B%2C-Dolby-Vision-%26-Atmos%2C-Smart-TV)/1611930642
My idea is to create a field in my collection that copies the name of the item upon submission by the user, and takes away all the problematic characters (such as &, % and +). It would then be used in the Wix Editor’s page settings to build links.
Any idea how to code this ?
Basically my code would look like this :
// button which submits the form with all the data needed (name of the item, price, name of the vendor...)
export function button15_click_1(event, $w) {
//text83 would take the value of the TITLE of the item (as inserted by user in input5) without taking into account special characters such as % & and +.
$w('#text83').text = $w('#input5').value;
//???? part missing to create some kind of RegEx
// the Fixed Title, ready for URL usage is set into its field in the database. This field will be used in the Wix Editor to build links for items' pages in this dataset
$w('#dataset1').setFieldValue('TITLEFIXED', $w("#text83").text);
}
