I have a small issue. I created a select box on my index page, where users should be able to select a link to go to an external website. This external url should not open in another tab, but inside my project. The values in this select box are pulled out of a database dynamically (that works fine). The issue I am facing now is when I click on the link name inside the select box, the redirect fails and shows that that method does not exist in my controller.
My code so far in my index :
<label for="externallink" class="control-label">External Links</label> <select id="externallink" name="externallink" onchange="this.options[this.selectedIndex].value && (window.location = this.options[this.selectedIndex].value);"> <option value="0">-Select Link-</option> </select>
How it looks when I open the source of my page :
<select id="externallink" name="externallink" class="form-control form-control-sm" onchange="this.options[this.selectedIndex].value && (window.location = this.options[this.selectedIndex].value);"><option value="">-Select Link-</option><option value="www.google.de">google</option><option value="www.youtube.com">Youtube</option></select>
Does anyone have an idea how to fix this, please ? Any help is much appreciated !
Try including the protocol in the URL. For example
People are also looking for solutions of the problem: object of class stdclass could not be converted to string
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.