I am using the below HTML code to connect a user to a chat, but I need any spaces in the URL generated to become %20 and not +, because + is a valid character in a nickname, so someone who enters Paul John in the input will become Paul+John instead in the chat, hence the %20 is needed as this is recognised as a space.
Is it possible to do this with JavaScript/jQuery and some example?
HTML
<form class="form-horizontal" role="form" action="client/htmlchat/123flashchat.html">
<fieldset>
<input type="hidden" name="init_room" value="1">
<!-- Text input-->
<div class="form-group">
<label class="col-sm-2 control-label" for="nickname">Nickname</label>
<div class="col-sm-10">
<input id="nickname" name="init_user" type="text" placeholder="Nickname" class="form-control" required="required">
</div>
</div>
<!-- Multiple Radios -->
<div class="form-group">
<label class="col-sm-2 control-label" for="gender">Gender</label>
<div class="col-sm-10">
<label class="radio" for="gender-0">
<input type="radio" name="init_gender" id="gender-0" value="2" required="required">
Female
</label>
<label class="radio" for="gender-1">
<input type="radio" name="init_gender" id="gender-1" value="1" required="required">
Male
</label>
</div>
</div>
<!-- Button -->
<div class="form-group">
<label class="col-sm-2 control-label" for="button"></label>
<div class="col-sm-offset-2 col-sm-10">
<button id="button" class="btn btn-lg btn-primary" type="submit">Enter</button>
</div>
</div>
</fieldset>
</form>
Thanks in advance,
Paul