Forum Replies Created

Viewing 15 replies - 91 through 105 (of 117 total)
  • Thread Starter pexel

    (@pexel)

    Now I watched the video, do we add code in this fieldname10 event to make it work?
    Could you please update the full code I will run?
    along with the one with fieldname10?
    Thank you for your support.

    Thread Starter pexel

    (@pexel)

    Thank you for your support. But the code did not work, so when we pressed the calculate button, the countdown did not work, the calculate button did not work at all.
    Note: I cleared the cache.

    Thread Starter pexel

    (@pexel)

    This way the code structure works but fieldname27; If I define it like this, it writes the result. It doesn’t delete the spaces in between. I tried as you gave. Not working.

    For example: TR80 0006 2000 0670 0006 6844 77 iban is valid but it says invalid. Actually my method is correct but the problem persists because of fieldname27 field.

    (function() {
      var iban = fieldname27;
    
      var ibanPattern = /^[A-Z]{2}\d{2}[A-Z0-9]{4}[0-9]{7}([A-Z0-9]?){0,16}$/;
    
      if (ibanPattern.test(iban)) {
        var numericIBAN = iban.substring(4) + iban.substring(0, 4);
        var numericIBANBigInt = BigInt(numericIBAN);
    
        var modValue = numericIBANBigInt % 97n;
        var isValid = modValue === 1n || (modValue === 0n && iban.substring(2, 4) === '00');
        var ibanStatus = isValid ? 'Ge?erli' : 'Ge?ersiz';
    
        jQuery('#calculation-iban').html(iban);
        jQuery('.kriter1-aciklama').html('IBAN:');
        jQuery('.kriter1-sonuc').html(ibanStatus);
    
        return [ibanStatus];
      } else {
        var ibanStatus = 'Ge?ersiz IBAN';
        jQuery('#calculation-iban').html(iban);
        jQuery('.kriter1-aciklama').html('IBAN:');
        jQuery('.kriter1-sonuc').html(ibanStatus);
    
        return [ibanStatus];
      }
    })();

    this is the full working code (I couldn’t adapt)

      function validateIBAN() {
          var iban = document.getElementById("fieldname27").value.replace(/[^a-zA-Z0-9]/g, '').toUpperCase();
    
          var ibanPattern = /^[A-Z]{2}\d{2}[A-Z0-9]{4}[0-9]{7}([A-Z0-9]?){0,16}$/;
    
          if (ibanPattern.test(iban)) {
            var countryCode = iban.substring(0, 2);
            var checkDigits = iban.substring(2, 4);
            var bban = iban.substring(4);
            var numericIBAN = bban + countryCode + checkDigits;
    
            var numericValue = "";
            for (var i = 0; i < numericIBAN.length; i++) {
              var charValue = numericIBAN[i].toUpperCase().charCodeAt(0) - 55;
              if (charValue >= 10 && charValue <= 35) {
                numericValue += charValue;
              } else {
                numericValue += numericIBAN[i];
              }
            }
    
            var mod97 = BigInt(numericValue) % 97n;
    
            if (mod97 === 1n) {
              document.getElementById("result").innerHTML = "IBAN ge?erli.";
            } else {
              document.getElementById("result").innerHTML = "IBAN ge?erli de?il.";
            }
          } else {
            document.getElementById("result").innerHTML = "Ge?erli bir IBAN girin.";
          }
        }
    • This reply was modified 1 year, 4 months ago by pexel.
    Thread Starter pexel

    (@pexel)

    thanks, i made a little code mistake, i fixed it thanks to you.

    Thread Starter pexel

    (@pexel)

    There should be no problem in the script right now, but it still doesn’t write results, I’ll go crazy ??

    function calculateGCD(a, b) {
      // Ensure positive values
      a = Math.abs(a);
      b = Math.abs(b);
    
      // Euclidean algorithm
      while (b !== 0) {
        var temp = b;
        b = a % b;
        a = temp;
      }
    
      return a;
    }
    
    var ebob;
    
    if (getField('fieldname14').val(true) === '02') {
      ebob = calculateGCD(getField('fieldname27').value, getField('fieldname26').value);
    }
    if (getField('fieldname14').val(true) === '03') {
      ebob = calculateGCD(getField('fieldname27').value, getField('fieldname26').value + getField('fieldname25').value);
    }
    
    // Output the result to HTML
    jQuery('#calculation-ebob').html(ebob);
    jQuery('.ebob-aciklama').html('En Büyük Ortak B?len EBOB / OBEB:');
    jQuery('.ebob-sonuc').html(ebob + ' TL');
    
    // Return the value of ebob
    return ebob;
    
    • This reply was modified 1 year, 5 months ago by pexel.
    Thread Starter pexel

    (@pexel)

    I still haven’t been able to solve the equation here. If the criterion is A, write the html results of A

    If the criterion is B, write the html results of B

    HTML Output

    <figure class="wp-block-table is-style-stripes"><table><tbody><tr><td style="text-align: left;"><b class="alici-aciklama mobile-aciklama">Hesaplama Sonucu :</b></td><td style="text-align: right;"><b><span data-cff-field="fieldname4"class="alici-sonuc mobile-sonuc" style="color:#ff6504;"></span></b><text style="color:#ff6504;"> </text></td>
    </tr><tr>
    <td style="text-align: left;"><b class="alicikdv-aciklama mobile-aciklama"></b></td><td style="text-align: right;"><b><span data-cff-field="fieldname4"class="alicikdv-sonuc mobile-sonuc" style="color:#ff6504;"></span></b><text style="color:#ff6504;"> </text></td>
    </tr><tr>
        <td style="text-align: left;"><b class="satici-aciklama mobile-aciklama"></b></td><td style="text-align: right;"><b><span data-cff-field="fieldname4"class="satici-sonuc mobile-sonuc" style="color:#ff6504;"></span></b><text style="color:#ff6504;"> </text></td>
    </tr><tr>
        <td style="text-align: left;"><b class="saticikdv-aciklama mobile-aciklama"></b></td><td style="text-align: right;"><b><span data-cff-field="fieldname4"class="saticikdv-sonuc mobile-sonuc" style="color:#ff6504;"></span></b><text style="color:#ff6504;"> </text></td>
    </tr><tr>
        <td style="text-align: left;"><b class="toplam-aciklama mobile-aciklama"></b></td><td style="text-align: right;"><b><span data-cff-field="fieldname14"class="toplam-sonuc mobile-sonuc" style="color:#ff6504;"></span></b><text style="color:#ff6504;"> </text></td>
    </tr><tr>
        <td style="text-align: left;"><b class="toplamkdv-aciklama mobile-aciklama"></b></td><td style="text-align: right;"><b><span data-cff-field="fieldname4"class="toplamkdv-sonuc mobile-sonuc" style="color:#ff6504;"></span></b><text style="color:#ff6504;"> </text></td>
    </tr><tr>
        <td style="text-align: left;"><b class="kiratoplam-aciklama mobile-aciklama"></b></td><td style="text-align: right;"><b><span data-cff-field="fieldname4"class="kiratoplam-sonuc mobile-sonuc" style="color:#ff6504;"></span></b><text style="color:#ff6504;"> </text></td>
    </tr><tr>
        <td style="text-align: left;"><b class="kiratoplamkdv-aciklama mobile-aciklama"></b></td><td style="text-align: right;"><b><span data-cff-field="fieldname4"class="kiratoplamkdv-sonuc mobile-sonuc" style="color:#ff6504;"></span></b><text style="color:#ff6504;"> </text></td>
    </tr><tr>
        </td></tr></tbody></table></figure>
    

    This is how the calculation function is.

    
    (function(){
      var alici, alicikdv, satici, saticikdv, toplam, toplamkdv, kiratoplam, kiratoplamkdv;
      
        if (fieldname14 == 'A') {
        alici = PREC(fieldname1 * 0.02, 2, true);
        jQuery('#calculation-alici').html(alici + ' TL');
        jQuery('.alici-aciklama').html('Al?c?n?n ?deyece?i Tutar :');
        jQuery('.alici-sonuc').html(alici + ' TL');
      }
        if (fieldname14 == 'A') {
        alicikdv = PREC(fieldname1 * 0.02 * 0.18, 2, true);
        jQuery('#calculation-alicikdv').html(alicikdv + ' TL');
        jQuery('.alicikdv-aciklama').html('Al?c?n?n ?deyece?i Tutar (KDV) :');
        jQuery('.alicikdv-sonuc').html(alicikdv + ' TL');
      }
      if (fieldname14 == 'A') {
        satici = PREC(fieldname1 * 0.02, 2, true);
        jQuery('#calculation-satici').html(satici + ' TL');  
        jQuery('.satici-aciklama').html('Sat?c?n?n ?deyece?i Tutar: :');
        jQuery('.satici-sonuc').html(satici + ' TL');
      }
        if (fieldname14 == 'A') {
        saticikdv = PREC(fieldname1 * 0.02 * 0.18, 2, true);
        jQuery('#calculation-saticikdv').html(alicikdv + ' TL');
        jQuery('.saticikdv-aciklama').html('Sat?c?n?n ?deyece?i Tutar (KDV) :');
        jQuery('.saticikdv-sonuc').html(saticikdv + ' TL');
      }
        if (fieldname14 == 'A') {
        toplam = PREC(fieldname1 * 0.04, 2, true);
        jQuery('#calculation-toplam').html(toplam + ' TL');
        jQuery('.toplam-aciklama').html('Toplam Tutar :');
        jQuery('.toplam-sonuc').html(toplam + ' TL');
      }
          if (fieldname14 == 'A') {
        toplamkdv = PREC(fieldname1 * 0.04 + (fieldname1 * 0.04 * 0.18), 2, true);
        jQuery('#calculation-toplamkdv').html(toplam + ' TL');
        jQuery('.toplamkdv-aciklama').html('Toplam KDV Tutar :');
        jQuery('.toplamkdv-sonuc').html(toplamkdv + ' TL');
      }
      
          if (fieldname14 == 'B') {
        kiratoplam = PREC(fieldname2, 2, true);
        jQuery('#calculation-kiratoplam').html(kiratoplam + ' TL');
        jQuery('.kiratoplam-aciklama').html('Toplam Tutar :');
        jQuery('.kiratoplam-sonuc').html(kiratoplam + ' TL');
      }
          if (fieldname14 == 'B') {
        kiratoplamkdv = PREC(fieldname2 + (fieldname2 * 0.18), 2, true);
        jQuery('#calculation-kiratoplamkdv').html(kiratoplamkdv + ' TL');
        jQuery('.kiratoplamkdv-aciklama').html('Toplam KDV Tutar :');
        jQuery('.kiratoplamkdv-sonuc').html(kiratoplamkdv + ' TL');
      }
      return [alici, alicikdv, satici, saticikdv, toplam, toplamkdv, kiratoplam, kiratoplamkdv];
    })();
    • This reply was modified 1 year, 6 months ago by pexel.
    • This reply was modified 1 year, 6 months ago by pexel.
    Thread Starter pexel

    (@pexel)

    Thank you for your support. We had a problem in a part while we were about to complete the form..

    We are now in the same calculation result section;
    We calculated the results by considering the criteria A and B.

    But when we write the result, we want the following.
    If criterion A is selected, write the results of criterion A. If B criterion is selected, write the results of B criterion.

    We tried to do this at the bottom, but it didn’t work, where do we go wrong?

    // Hide B results
        jQuery('.kiratoplam-aciklama, .kiratoplam-sonuc, .kiratoplamkdv-aciklama, .kiratoplamkdv-sonuc').hide();
        // Show A results
        jQuery('.alici-aciklama, .alici-sonuc, .alicikdv-aciklama, .alicikdv-sonuc, .satici-aciklama, .satici-sonuc, .saticikdv-aciklama, .saticikdv-sonuc, .toplam-aciklama, .toplam-sonuc, .toplamkdv-aciklama, .toplamkdv-sonuc').show();
        // Hide A results
        jQuery('.alici-aciklama, .alici-sonuc, .alicikdv-aciklama, .alicikdv-sonuc, .satici-aciklama, .satici-sonuc, .saticikdv-aciklama, .saticikdv-sonuc, .toplam-aciklama, .toplam-sonuc, .toplamkdv-aciklama, .toplamkdv-sonuc').hide();
        // Show B results
        jQuery('.kiratoplam-aciklama, .kiratoplam-sonuc, .kiratoplamkdv-aciklama, .kiratoplamkdv-sonuc').show();
      }
    Thread Starter pexel

    (@pexel)

    Thanks a lot.
    So, is it possible to search without showing the area in the picture?
    When the user writes, the search results will appear.

    Thread Starter pexel

    (@pexel)

    Thanks, I realized my mistake and got the result.
    A very impressive plugin.

    Thread Starter pexel

    (@pexel)

    then I’m writing to wrap it up, if there is a wrong part, I would appreciate it if you could help.
    When adding a date function;

    (function(){
    var sonucsure = fieldname17;
    
    sonucsure = DATETIMESUM(sonucsure, 'dd/mm/yyyy', fieldname19, 'y');
    sonucsure = DATETIMESUM(sonucsure, 'dd/mm/yyyy', fieldname20, 'm');
    sonucsure = DATETIMESUM(sonucsure, 'dd/mm/yyyy', fieldname21*7+fieldname22, 'd');
    jQuery('#calculation-sonucsure').html(sonucsure);
    return GETDATETIMESTRING(sonucsure, 'dd/mm/yyyy');
    })()

    I couldn’t print the result “calculation-sonucsure”

    In fact, I’m currently thinking about how to do the subtraction as above and vice versa. I failed ??

    Thread Starter pexel

    (@pexel)

    What if we want to extract it the same way?
    You’re great at support, by the way.

    Thread Starter pexel

    (@pexel)

    Thanks We contacted.

    Thread Starter pexel

    (@pexel)

    Could you please pull a sample data from this xml?
    We want to improve ourselves based on this example.
    We would be very happy if you could help with this.

    Thread Starter pexel

    (@pexel)

    Hi yes, thank you very much.
    How to translate the warning at the bottom into Turkish.

    This field is required.

    Thread Starter pexel

    (@pexel)

    Hello, the code works fine, but it goes directly to the calculation without considering the mandatory fields.
    Is it possible to consider the required fields in this code before proceeding with the calculation?
    For example, 1 cell is not filled, he said, calculate visitor. Before proceeding with the counting process, it should give a signal warning that please fill in the mandatory fields.
    Thanks.

    my_counter=5,my_interval=setInterval(function(){jQuery(".counter").html("Text : " + my_counter + " saniye"),(my_counter-=1)<0&&(clearInterval(my_interval),jQuery(".counter").html(""),EVALEQUATIONS())},1e3);
Viewing 15 replies - 91 through 105 (of 117 total)