As a pure CSS solution, we could have two <input>s – having different placeholders – which are shown in different screen sizes – Example here:
input.large { display: inline-block; }
input.small { display: none; }
@media (max-width: 399px) {
input.large { display: none; }
input.small { display: inline-block; }
}
<input type="email" name="email[]" class="required email large" id="mce-EMAIL" placeholder="Your Email">
<input type="email" name="email[]" class="required email small" placeholder="Join our newsletter">
Important notes:
-
In this case we should make sure that the
idof our twoinputs are different. Besides, Ifidis added to<input>just because of its usage forlabelelements, we could just wrap theinputbylabelinstead. -
Using more than one
inputwhich have the samename, will override thename/valuepair in HTTP request method.
One possible solution is to use an array name value for name attribute, (as example above) and handle it at server-side (It’s better to keep name values in lowercase).
Alternatively, we could disable the hidden input in order to prevent its value from being sent to server:
$('input:hidden').prop("disabled", true);
Using JavaScript in a Pure CSS Solution? Maybe… maybe not… but nowadays no websites in the modern world are empty of JavaScript. If it helps to get rid of the problem, it’s alright to get hands a little dirty!.