Add data from text form to button link

Hi there, I need your help in linking the text from’s data to the link’s string when I click to a button.

For example:


When we type “bear” in the Animal Name form => click on Search button => it will open a link in another window:

How can we do that? I know it needs some code here but I don’t know what exactly that is.

Thank you for your help!

Check here →
https://www.wix.com/corvid/reference/$w/button/link
https://www.wix.com/corvid/reference/$w/button/target

Hi Ajit Kumar ,
I checked your link and try something but it doesn’t work. Sorry I’m not familiar with these code things :frowning:
What I meant is combining 2 strings to the link when the button is clicked. 1 is fix, and 1 from the text form. Can you show me how I should create the code?
Thank you a lot for your help!

Ok !!

For what you are trying to do … you should have the respective pages

Code would be more like →

//under the submit button OnClick event 

let url = $w('#input1').value;
let id = `${url}`
wixLocation.to(`https://thenikkistudio.tumblr.com/tagged/${url}`);

Thank you! I tried it but it showed an error like this:

On the top of your code add this statement →

(1st line of your code)

import wixLocation from'wix-location';

It works now. Thank you a lot of for your help! :blush:

Your Welcome !!