Jump to content

jeff73230

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by jeff73230

  1. Hi Ingolme, Thanks for reply... but it did not work. I still have every month since August (even after emptying history, cache and erasing cookies). Should not it work even without having to set the day and the month with zeros on the left ????? By taking today as an example, the day or the month are made of two digits (I totally agree that if I had taken November 2 or 3 as an example it would not have worked). Do you have some lines of code that I could use to try to set the day and month with zeros on the left ? Thanks anyway 😉
  2. Hi everyone, On a new project, i would like to prevent users from entering a date earlier than the first day of the month preceding the current month. To be more precise, today (dd/mm/yy -> 19/11/19) i would like to prevent entering a date earlier than 01/10/19 (dd/mm/yy format). When using following code. It works. <!DOCTYPE html> <html> <body> <p>Click the button to display first day of preceding current month.</p> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { var dateMin = new Date(); dateMin.setFullYear(dateMin.getFullYear(), dateMin.getMonth() - 1, 1); document.getElementById("demo").innerHTML = dateMin; } </script> </body> </html> When i click on Try it button, on 19th november 2019, i've got Tue Oct 01 2019 (+ time) displayed. But when using following code in my .js file : var dateMin = new Date(); dateMin.setFullYear(dateMin.getFullYear(), dateMin.getMonth() - 1, 1); $(function () { $("input[InputTypeCheck='DateSaisieMin']").datepicker({ onSelect: function () { }, dateFormat: 'dd/mm/yy', minDate: dateMin, changeYear: true, changeMonth: true }, $.datepicker.regional['fr']).attr('readonly', 'readonly'); }); and following code in my .aspx file : <p> <label class="LblLibelle">Date</label> &nbsp;&nbsp; <asp:TextBox ID="txt_dateDeclaration" runat="server" InputTypeCheck="DateSaisieMin" AutoPostBack="true"></asp:TextBox> <asp:RequiredFieldValidator ID="rfv_dateDeclaration" runat="server" ControlToValidate="txt_dateDeclaration" Display="Dynamic" ErrorMessage="La date de l'absence est obligatoire" ValidationGroup="ajout"> <label class="zoneObligatoire">&nbsp;*</label> </asp:RequiredFieldValidator> </p> I was expecting to be unable to select a date in the datepicker prior to 01/10/2019, but this is not the case. The datepicker shows every month since August. Can someone tell me where I made a mistake ? Many Thanks to all.
  3. Hi Funce, Sorry for late reply. Many Thanks for these ideas. First point (show test_2 only when test_1 is checked) is working only when i click on test_1. My question was not precise enough as i would like to have Test_2 also not showed at form opening. <div class="col-md-1" style=""> <div class="col-sm-12"> <input type="checkbox" name="test_1" id="test_1" onchange="DisplayToggle()" data-toggle="toggle" data-on="Yes" data-off="No" data-onstyle="success" data-offstyle="danger"> </div> </div> <div class="col-md-1" style="" id="madiv2" style="display:none"> <div class="col-sm-12"> <input type="checkbox" name="test_2" id="test_2" data-toggle="toggle" data-on="Yes" data-off="No" data-onstyle="success" data-offstyle="danger"> </div> </div> I've tried as above style="display:none" but it doesn't worked... Test_2 toggle button is showed at form opening... Concerning PHP code for value of test_1 and test_2, as i have to work on another project, i will have a look on it in a few weeks... Many thanks again for help 😉
  4. Hi Everyone, I'm trying in a bootstrap view to replace two dropdown lists (yes/no) by two toggle checkboxes. Here is the part of code used on the Edit View : <div class="row"> <div class="col-md-3" style=""> <div class="col-sm-12"> <label for="d_c" class="col-sm-12 control-label">DC</label> </div> </div> <div class="col-md-3" style="" > <div class="col-sm-12"> <label for="i_m_c" class="col-sm-12 control-label">IMC</label> </div> </div> <div class="col-md-6" style="" > <div class="col-sm-12"> </div> </div> <div class="col-md-3" style=""> <div class="col-sm-12"> <input type="checkbox" name="test_1" id="test_1" data-toggle="toggle" data-on="Yes" data-off="No" data-onstyle="success" data-offstyle="danger"> </div> </div> <div class="col-md-3" style=""> <div class="col-sm-12"> <input type="checkbox" name="test_2" id="test_2" data-toggle="toggle" data-on="Yes" data-off="No" data-onstyle="success" data-offstyle="danger"> </div> </div> <div class="col-md-6" style="" > <div class="col-sm-12"> </div> </div> </div> When i check the test_1, 'on' is stored in my (sql) database, when i check test_2, 'on' is also stored. my problem is that i would like to be able to have test_2 toggle button visible only when test_1 toggle button is checked, and when test_1 is not checked to store 'NULL' as test_2 value. And when test_2 is checked to force test_1 value to be 'on', and force test_2 value to 'NULL' if test_1 is not checked. ALL that I tried in javascript ended in a failure, so if there is anybody who can tell me how to get out of it, any help will be really appreciated. (i have try following javascript (div names have been removed from code above as nothing worked as i want to)) <script type="text/javascript"> function Change() { if ((document.getElementById('test_1').checked)) { document.getElementById('madiv').style.display="block"; document.getElementById('madiv2').style.display="block"; } else { document.getElementById('madiv').style.display="none"; document.getElementById('madiv2').style.display="none"; } } </script> And if anybody can tell me how to get the checkbox value on another bootstrap form (Modify View)... i'tried with value="<?php echo...; ?>" but it doesn't worked.. a big big thanks in advance. (sorry for my poor english) Have a nice day. Jeff
×
×
  • Create New...