Please how do i cobine the content of two input element to form 1 string. something like this:
input1.value = boy
input1.value = girl
thgen inputbox input3.value = boygirl
Please how do i cobine the content of two input element to form 1 string. something like this:
input1.value = boy
input1.value = girl
thgen inputbox input3.value = boygirl
$w(“#input3”).value = $w(“#input1”).value + $w(“#input2”).value;
Thanks works well, how do perform mathematical operations lil
1+2=3
Several ways:
$w(" #input3 “).value = Number($w(” #input1 “).value) + Number($w(” #input2 “).value);
$w(” #input3 “).value = parseInt($w(” #input1 “).value) + parseInt($w(” #input2 “).value);
$w(” #input3 “).value = parseFloat($w(” #input1 “).value) + parseFloat($w(” #input2 ").value);
I would suggest visiting the following sites for information on programming in Javascript:
Good luck and have fun!
sir is this at the backend?
no - the code in the posts above is using screen components
Thank you sir. Sorry i am new at coding. What I’d like to do is to concatenate last name, surname middle name and put its value to #FULLNAME. Definitely not doin it right. Can you please help me? below is my code…
// For full API documentation, including code examples, visit Velo API Reference - Wix.com
$w.onReady( function () {
$w( ‘#FirstName’ ).value= “” ;
$w( ‘#MiddleName’ ).value= “” ;
$w( ‘#LastName’ ).value= “” ;
$w( ‘#MobileNumber’ ).value= “” ;
$w( ‘#EmailAddress’ ).value= “” ;
$w( ‘#Password’ ).value= “” ;
});
export function FirstName_input(event) {
//Add your code for this event here:
}
export function MiddleName_input(event) {
//Add your code for this event here:
}
export function LastName_input(event) {
//Add your code for this event here:
}
export function MobileNumber_input(event) {
//Add your code for this event here:
}
export function EmailAddress_input(event) {
//Add your code for this event here:
}
export function Password_input(event) {
//Add your code for this event here:
}
export function OK_click(event) {
//Add your code for this event here:
}
function lastname() {
if ($w( ‘#LastName’ ).value=== “” ){
$w( ‘#LastName’ ).value=lastname();
}
else {
$w( ‘#LastName’ ).value= “” ;
}
}
function firstname() {
if ($w( ‘#FirstName’ ).value=== “” ){
$w( ‘#FirstName’ ).value=firstname();
}
else {
$w( ‘#FirstName’ ).value= “” ;
}
}
function middlename() {
if ($w( ‘#MiddleName’ ).value=== “” ){
$w( ‘#MiddleName’ ).value=middlename();
}
else {
$w( ‘#MiddleName’ ).value= “” ;
}
}
function mobilenumber() {
if ($w( ‘#MobileNumber’ ).value=== “” ){
$w( ‘#MobileNumber’ ).value=mobilenumber();
}
else {
$w( ‘#MobileNumber’ ).value= “” ;
}
}
function emailaddress() {
if ($w( ‘#EmailAddress’ ).value=== “” ){
$w( ‘#EmailAddress’ ).value=emailaddress();
}
else {
$w( ‘#EmailAddress’ ).value= “” ;
}
}
function password() {
if ($w( ‘#Password’ ).value=== “” ){
$w( ‘#Password’ ).value=password();
}
else {
$w( ‘#Password’ ).value= “” ;
}
}
function valueCombine(){
let fullnamebox=$w( ‘#LastName’ ).value+ " " +$w( ‘#FirstName’ ).value+ " " +$w( ‘#MiddleName’ );
$w( ‘#FULLNAME’ ).value=fullnamebox;
}
export function FULLNAME_input(event) {
$w( ‘#FULLNAME’ ).value=$w( ‘#LastName’ ).value+$w( ‘#FirstName’ ).value+$w( ‘#MiddleName’ );
}
You will need to learn the basics of programming in Corvid. R ead the following articles that will help you start working with Corvid:
About Corvid by Wix - what Corvid is and what features it has.
Getting Started with Corvid by Wix - step-by-step tutorial on how to start using Corvid.
Onboarding to Corvid by Wix - introduction to Corvid with short tutorials.
Ok sir… just did… helped me alot… just got wut I wanted. my code is now working… thanks again…
That’s great!!! I’m glad you were able to work it out. Have fun and good luck.
Hi there,
Help me!
I want to combine a dataset’s value (after search ) with a text. My page code is
1st page code :
import {session} from ‘wix-storage’ ;
import wixLocation from ‘wix-location’ ;
$w.onReady( function () {
});
export function SearchButton_click(event) {
let word = $w( ‘#SearchBar’ ).value;
session.setItem( "SearchWord" , word)
wixLocation.to(`/results`);
}
2nd page
import {session} from ‘wix-storage’ ;
import wixData from ‘wix-data’ ;
$w.onReady( function () {
var sameWord = session.getItem( “SearchWord” );
$w( ‘#SearchBar’ ).value = sameWord;
$w( ‘#SearchBar’ ).placeholder = sameWord;
$w( ‘#dataset1’ ).onReady( function () {
search();
});
});
export function SearchButton_click(event) {
search();
}
function search() {
wixData.query( ‘Questions’ )
.contains( ‘answer’ , $w( “#SearchBar” ).value)
.find()
.then(res => {
$w( ‘#repeater1’ ).data = res.items;
});
}
Here after search I want to combine a text to the result
editor url :
https://editor.wix.com/html/editor/web/renderer/edit/67bc9b2e-0acc-469d-9a24-10ebdcd1343f?metaSiteId=724b8285-e2e6-417b-822a-6f26095f95ea&editorSessionId=f0feb9f5-a48a-4a0f-b574-0a9d98122ab6&referralInfo=dashboard
actually the website is not designed
This is a very old post, that has little to do with your question. Please repost your question in a new post so more people will see it. Clearly explain what you are trying to do and what you want to accomplish.
@yisrael-wix ok