I am a Junior dev in internship and I would like have a correct answer about my problem…
I need to modify a web app for my company, my tutor want use a new context on a form for doing connected test (currently the form use a another context)
The problem is she want to had this method on the same form with a new button for connected test….
My major problem is the form only use the first orignal button and i can’t add a new button (if I do that the new button will act exactly like the old one)
With this new “connected” button I need to call my new context but right now I can’t see if my new context work because the current button doesn’t call this one.
So this is my redirect.html page
<div class="col col-md-6" id="PUCContext">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">PUC Context</h3>
</div>
<div class="panel-body">
<div th:if="${exception==null}">
<input hidden="hidden" id="submitPuc" th:value="${submitPuc}">
<form id="lanceurForm" target="lanceurFrame" hidden="hidden"
th:object="${hcontext}" th:action="${havanaPucUrl}"
method="post">
<div class="form-group">
<textarea th:field="*{ihmLaunchParams}" name="ihmLaunchParams"
rows='13' maxlenght='3000' class="form-control"
id="ihmLaunchParams"></textarea>
</div>
</form>
</div>
<div class="form-group">
<div class="input-group">
<div class="input-group-addon">Identifiant agence</div>
<select id="idAgence" name="idAgence" class="form-control">
<option th:each="elem : ${IdAgences.idAgences}"
th:value="${elem}" th:text="${elem}"></select>
</div>
</div>
{other data from my form ...}
<button id="submitPuc" type="submit"
class="btn btn-default" >Test Bouchonné</button>
<button id="submitTestConnecte" type="submit" class ="btn btn-default" >Test Connecté </button>
</form>
</div>
and this is my redirect.js page :
//Button "Test Bouchonné Context PUC"
$(document).ready ( function () {
$("#PUCEvents").hide();
var submitPuc = $("#submitPuc").val();
if(!!submitPuc){
$( "#lanceurForm" ).submit();
//$("#globalLanceur").hide();
$("#BAMFormulaire").hide();
$("#SAVCAFormulaire").hide();
$("#PUCContext").hide();
$("#PUCContext").hide();
$("#PUCEvents").hide();
$( "#PUCEvents" ).removeClass('col-md-3').addClass('col-md- 7').addClass('col-md-offset-3')
$("#havana").show();
}
//Button "Test connecté Context PUC"
$(document).ready(function () {
$("#PUCEvents").hide();
var submitTestConnecte = $("#submitTestConnecte").val();
if (!!submitTestConnecte) {
$( "#lanceurForm2" ).submit();
// Hide forms and modify classes as you are doing
$("#BAMFormulaire").hide();
$("#SAVCAFormulaire").hide();
$("#PUCContext").hide();
$("#PUCEvents").hide();
$("#PUCEvents").removeClass('col-md-3').addClass('col-md-7').addClass('col-md-offset-3');
$("#havana").show();
// Redirect after a short delay to allow any submission process to complete
setTimeout(function() {
window.location.href = '/connecte';
}, 1000);
}
});
this page manages the redirection of my buttons
I’m trying to get my new button to work correctly so that it can call my context (so that I can test it)