[Modify user] Field selector scripted to modify & revert form elements for email input check
#1
This commit is contained in:
parent
4147e8568b
commit
4a42f46089
1 changed files with 11 additions and 1 deletions
|
@ -12,7 +12,7 @@
|
||||||
<label for="pass">Password</label>
|
<label for="pass">Password</label>
|
||||||
<input type="password" id="pass" name="pass"/> <br/>
|
<input type="password" id="pass" name="pass"/> <br/>
|
||||||
<label for="field">Field</label>
|
<label for="field">Field</label>
|
||||||
<select id="field">
|
<select onchange="selectField()" id="field">
|
||||||
<option value="" selected="selected">Please select an option</option>
|
<option value="" selected="selected">Please select an option</option>
|
||||||
<option value="mail">Email</option>
|
<option value="mail">Email</option>
|
||||||
<option value="sshPublicKey">SSH key</option>
|
<option value="sshPublicKey">SSH key</option>
|
||||||
|
@ -58,6 +58,16 @@
|
||||||
document.getElementById('formStatus').innerHTML = "<span style='background-color: red; color: white'>Please select a field to modify</span>";
|
document.getElementById('formStatus').innerHTML = "<span style='background-color: red; color: white'>Please select a field to modify</span>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function selectField(){
|
||||||
|
const field = document.getElementById('field').value;
|
||||||
|
const value = document.getElementById('value');
|
||||||
|
if(field === 'mail'){
|
||||||
|
value.type = 'email';
|
||||||
|
} else {
|
||||||
|
value.type = 'text';
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
<script>
|
<script>
|
||||||
|
|
Loading…
Reference in a new issue