Hello!
I have run into a problem that I can´t solve and I hope someone here can help me…
I have sevral links like that contains data that I want to insert into two input fields onclick.
My links look like this:
<a href=”#” class=”squarename_avalible” onclick=”fillsquare(21, test2)”>21</a>
<a href=”#” class=”squarename_avalible” onclick=”fillsquare(22, test2)”>22</a>
<a href=”#” class=”squarename_avalible” onclick=”fillsquare(23, test2)”>23</a>
etc…
I would like the link below to put 21 to be put into the input named “squareName” and test2 to be put into the input named “areaName”
<a href=”#” class=”squarename_avalible” onclick=”fillsquare(21, test2)”>21</a>
My form looks like this:
<form name=”booking_form_final” action=”<?php echo htmlspecialchars($_SERVER[“PHP_SELF”]); ?>” method=”post”>
<div class=”form-group”>
<label>fyll i område</label>
<input type=”text” name=”areaName” class=”form-control” value=””>
</div>
<div class=”form-group”>
<label>fyll i rutans nummer</label>
<input type=”text” name=”squareName” class=”form-control” value=””>
</div>
<div class=”form-group”>
<input type=”submit” class=”btn btn-primary” value=”Boka”>
<input type=”reset” class=”btn btn-default float-right” value=”Rensa allt.”>
</div>
</form>
Best regards