Hi,
I have this code and would like to insert a line return (line break) to a text.
I cumulate in a var some text and want to display one element per line like this:
<>
Nom de famille trop court
Prénom trop court
Entrez une description de votre dernier poste chez IBM
Entrez l’année de départ de chez IBM
See the lines in bold. What I did, doesn’t work.
Can someone has an idea on how to do it
Thank you
Pierre Lacasse
import wixLocation from ‘wix-location’;
$w.onReady( function () {
$w(“#button1”).show();
$w(“#button6”).hide();
$w(“#vectorImage7”).collapse();
$w(“#vectorImage6”).collapse();
$w(“#vectorImage5”).collapse();
$w(“#vectorImage4”).collapse();
});
export function button6_click_1(event, $w) {
//$w(“#dynamicDataset”).save();
wixLocation.to(“/a-propos”);
}
export function button1_click_1(event, $w) {
var formvalid = 1;
var txtErrorOut = “”;
var nfamille = $w(“#input7”).value;
if (nfamille.length < 2)
{
formvalid = 0;
-----> txtErrorOut = txtErrorOut + “Nom de famille trop court
”;
$w(“#vectorImage7”).expand();
}
else {
$w(“#vectorImage7”).collapse();
}
var prenom = $w(“#input6”).value;
if (prenom.length < 2)
{
formvalid = 0;
-----> txtErrorOut = txtErrorOut + “Prénom trop court
”;
$w(“#vectorImage6”).expand();
}
else {
$w(“#vectorImage6”).collapse();
}
var dernierposte = $w(“#input4”).value;
if (dernierposte.length < 2)
{
formvalid = 0;
-----> txtErrorOut = txtErrorOut + “Entrez une description de votre dernier poste chez IBM
”;
$w(“#vectorImage4”).expand();
}
else {
$w(“#vectorImage4”).collapse();
}
var anneedepart = $w(“#input5”).value;
if (anneedepart.length < 2)
{
formvalid = 0;
----->txtErrorOut = txtErrorOut + “Entrez l’année de départ de chez IBM”;
$w(“#vectorImage5”).expand();
}
else {
$w(“#vectorImage5”).collapse();
}
//console.log (formvalid)
if (formvalid === 1)
//return “OK”;
{
$w(“#button6”).show();
$w(“#button1”).hide();
//$w(“#dynamicDataset”).save();
//document.forms[0].submit();
}
else
{
-----> $w(“#text7”).text = txtErrorOut
$w(“#button6”).hide();
$w(“#button1”).show();
}
}