Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script src="http://www.w3schools.com/lib/w3data.js"></script>
- <!-- other js imports... -->
- <script>
- function selectCheck(event) {
- var opt = this.options[this.selectedIndex].value;
- if (opt == "opt1"){
- //Load in html the file form.html
- }
- else{
- //Load in html the file form2.html
- }
- }
- </script>
- <!-- other scripts... -->
- </head>
- <body>
- <div class="form-group">
- <label for="exampleFormControlSelect1">Example select</label> <select
- class="form-control" id="exampleFormControlSelect" onchange="selectCheck.call(this, event)">
- <option value="opt1">option 1</option>
- <option value="opt2">option 2</option>
- </select>
- </div>
- <!-- the following lines load the html, but without any control. Here only the selected html should be loaded -->
- <div w3-include-html="html/form.html"></div>
- <div w3-include-html="html/form2.html"></div>
- <script>
- w3IncludeHTML();
- </script>
- </body>
Add Comment
Please, Sign In to add comment