testing a more dynamic form

This commit is contained in:
Jesse James Isler 2022-03-31 13:30:02 +02:00
parent 478d0ce6a4
commit 85ee15a4cd

View File

@ -28,20 +28,20 @@
<div class="row"> <div class="row">
<div class="col s6"> <div class="col s6">
<div class="card-panel white"> <div class="card-panel white">
<form> <form id="mainform">
<div class="row"> <div class="row">
<div class="input-field col s3"> <div class="input-field col s3">
<input id="name" type="text" onchange="updateCard()"> <input id="name" type="text">
<label for="name">Rolename</label> <label for="name">Rolename</label>
</div> </div>
<div class="input-field col s9"> <div class="input-field col s9">
<input id="description" type="text" onchange="updateCard()"> <input id="description" type="text">
<label for="description">Roledescription</label> <label for="description">Roledescription</label>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="input-field col s3"> <div class="input-field col s3">
<select id="rolecolor" onchange="updateCard()"> <select id="rolecolor">
<option value="" disabled selected>Color</option> <option value="" disabled selected>Color</option>
<option value="red">Red</option> <option value="red">Red</option>
<option value="pink">Pink</option> <option value="pink">Pink</option>
@ -69,7 +69,7 @@
<label>Select color</label> <label>Select color</label>
</div> </div>
<div class="input-field col s3"> <div class="input-field col s3">
<select id="modifier" onchange="updateCard()"> <select id="modifier">
<option value="" selected>None</option> <option value="" selected>None</option>
<option value="lighten">Lighten</option> <option value="lighten">Lighten</option>
<option value="darken">Darken</option> <option value="darken">Darken</option>
@ -78,7 +78,7 @@
<label>Select Modifier</label> <label>Select Modifier</label>
</div> </div>
<div class="input-field col s3"> <div class="input-field col s3">
<select id="strength" onchange="updateCard()"> <select id="strength">
<option value="" selected>No Strength</option> <option value="" selected>No Strength</option>
<option value="1">1</option> <option value="1">1</option>
<option value="2">2</option> <option value="2">2</option>
@ -88,7 +88,7 @@
<label>Select Strength</label> <label>Select Strength</label>
</div> </div>
<div class="input-field col s3"> <div class="input-field col s3">
<select id="tcolor" onchange="updateCard()"> <select id="tcolor">
<option value="" disabled selected>Textcolor</option> <option value="" disabled selected>Textcolor</option>
<option value="black-text">Black</option> <option value="black-text">Black</option>
<option value="white-text">White</option> <option value="white-text">White</option>
@ -98,13 +98,13 @@
</div> </div>
<div class="row"> <div class="row">
<div class="input-field col s12"> <div class="input-field col s12">
<textarea id="howtoplay" onchange="updateCard()" class="materialize-textarea"></textarea> <textarea id="howtoplay" class="materialize-textarea"></textarea>
<label for="howtoplay">Text to describe how to play</label> <label for="howtoplay">Text to describe how to play</label>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="input-field col s12"> <div class="input-field col s12">
<select id="goodRoles" onchange="updateCard()" multiple> <select id="goodRoles" multiple>
<option value="" disabled> Choose your option </option> <option value="" disabled> Choose your option </option>
<?php <?php
$files = glob("roles/en/*.php"); $files = glob("roles/en/*.php");
@ -213,6 +213,10 @@
<!-- Updatescript --> <!-- Updatescript -->
<script> <script>
$('#mainform').change(updateCard());
function updateCard() { function updateCard() {
updateName(); updateName();
updateColor(); updateColor();