If you were to embed your form on a different page, your approach will work.
For example you can place your form on /landing-page with a redirect to a different page:
1 <form action ="/recruitment-form" method ="GET" >
2 <input type ="text" id ="jobtitle" name ="jobtitle" placeholder ="Enter your job title here" >
3 <button type ="submit" > continue</button >
4 </form >
Submitting the form will take you to URL like this: /recruitment-form?jobtitle=engineer
Then, on the /recruitment-form page you can display the form:
1 <button
2 data-tf-popup ="iKrAInr4"
3 data-tf-opacity ="100"
4 data-tf-size ="100"
5 data-tf-iframe-props ="title=CB - Sales (hidden fields)"
6 data-tf-transitive-search-params ="jobtitle"
7 data-tf-medium ="snippet"
8 data-tf-hidden ="jobtitle=xxxxx"
9 style ="all:unset;font-family:Helvetica,Arial,sans-serif;display:inline-block;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;background-color:#0445AF;color:#fff;font-size:20px;border-radius:25px;padding:0 33px;font-weight:bold;height:50px;cursor:pointer;line-height:50px;text-align:center;margin:0;text-decoration:none;"
10 > Start recruiting</button >
11 <script src ="//embed.typeform.com/next/embed.js" > </script >
You can add data-tf-open=”load” to your button to open it automatically on page load.
Alternatively you could build this in a single page using Typeform Embed SDK and some JavaScript code:
1 <input type ="text" id ="job-title-input" placeholder ="Enter your job title here" />
2
3 <button id ="my-typeform-button" style ="all:unset;font-family:Helvetica,Arial,sans-serif;display:inline-block;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;background-color:#0445AF;color:#fff;font-size:20px;border-radius:25px;padding:0 33px;font-weight:bold;height:50px;cursor:pointer;line-height:50px;text-align:center;margin:0;text-decoration:none;" > Start recruiting</button >
4
5 <link rel ="stylesheet" href ="//embed.typeform.com/next/css/popup.css" />
6 <script src ="//embed.typeform.com/next/embed.js" > </script >
7
8 <script >
9 document.querySelector('#my-typeform-button').onclick = () => {
10 window.tf.createPopup('iKrAInr4', {
11 size: 100,
12 hidden: {
13 jobtitle: document.querySelector('#job-title-input').value
14 }
15 }).open()
16 }
17 </script >