0

I'm setting up a form on a static page, where users will "input" text + "select" option, then the "submit"button should modify the iframe "scr" url to https://example.com/"text value"+"option "

I went on some other pages, but couldn't find a simple script to it

<form>First name:<br>
<input type="text" name="firstname">

<select>
<option value="A">A</option>
<option value="B">B</option>
</select>

<input type="submit" value="Submit">

</form>

<iframe src="https://example.com/"> </iframe>

<script> ...  </script>
Tim
  • 19
  • 4
  • So you have multiple steps to sort out and haven't shown any effort to accomplish any of those steps. Have you tried anything? If so - show what you have tried... if not - break this up into small steps and research each one then start combining them – charlietfl Jul 18 '19 at 16:52
  • Hi, I have tried to combine that solution https://stackoverflow.com/questions/46781030/form-input-to-change-url/46781082 with that one https://stackoverflow.com/questions/3730159/changing-iframe-src-with-javascript, but was unsuccessful – Tim Jul 18 '19 at 17:03
  • OK..so the big difference is (I think) you don't want the actual form to submit by default browser submit process which means you need to prevent the default event. Otherwise page will reload due to default process – charlietfl Jul 18 '19 at 17:06
  • thanks, well I tried the following https://codepen.io/anon/pen/GVgEJy, but guess i am missing some basics here – Tim Jul 19 '19 at 08:43

0 Answers0