I’m having a problem once again, and as you always helped me solve it, hence i’m here again.
In Joomla, we have created a website used for renting/bookings of Villa’s with the portal Jomres.
Now in the backend, we can change the location of a Villa ofcourse, and this work with a dropdownbox with an onchange function.
Now here lies the problem, if we for example, click on: Cala d’Hort
Then in the inputfield(not writable) it comes as Cala d.
It breaks up everything after the apostrophe.
I’ve tried a bit with encoding or escaping characters, however it did not work.
The little Javascript that is behind this is:
function stext(selectid, textid) {
var select = document.getElementById(selectid);
var selectvalue = select.value;
var text = document.getElementById(textid);
text.value = selectvalue;
}
And the HTML:
<select onchange="stext('select', 'town')" id="select" class="sbox">
Is there a way that it does not break and provides the full name instead of breaking it down?
Thank you in advance!
Jeroen
This jsfiddle describes both a working and a non-working example using the JavaScript you provided. The HTML is as follows:
My guess is that you have incorrectly nested quotes in your
optiontags.