I want to select all the inputs with name attribute end with *Name
.
I have 6 inputs type text with name :
- deviceName
- profileName
- ssidName
- captiveName
- trafficName
- sessionName
HTML
<input class="form-control" type="text" name="deviceName">
<input class="form-control" type="text" name="profileName">
<input class="form-control" type="text" name="ssidName">
<input class="form-control" type="text" name="captiveName">
<input class="form-control" type="text" name="trafficName">
<input class="form-control" type="text" name="sessionName">
I'm trying to prevent any space enter on those 5 inputs
I've tried
$("input[name='*Name']").keyup(function() {
this.value = this.value.replace(/\s/g, '');
});
My selection doesn't seem to take any effects.