최근 검색


최근 검색 없음

Dustin Swayne's Avatar

Dustin Swayne

가입한 날짜: 2021년 4월 15일

·

마지막 활동: 2024년 11월 23일

팔로잉

0

팔로워

0

총 활동 수

39

투표 수

11

플랜 수

12

활동 개요

님의 최근 활동 Dustin Swayne

Dustin Swayne님이 에 댓글을 입력함

커뮤니티 댓글 Q&A - Help center and community

How can I pop an alert in a certain field equals a value on change?  tried this:

 

document.addEventListener("DOMContentLoaded", function() {
   // Check if the value in props.requestForm.ticket_fields[256] is "No"
   if (props.requestForm.ticket_fields[256] && props.requestForm.ticket_fields[256].value === "no_rejects") {
       // Trigger the alert
       alert("The value is 'No'. Please take necessary action.");
   }
});

 

but doesn't work….

댓글 보기 · 2024년 11월 23일에 게시됨 · Dustin Swayne

0

팔로워

0

투표 수

0

댓글


Dustin Swayne님이 에 댓글을 입력함

커뮤니티 댓글 Q&A - Help center and community

Adding the following the script on the New Request page works to hide the cc field:

 

props.requestForm.cc_field = false;

 

 

댓글 보기 · 2024년 11월 23일에 게시됨 · Dustin Swayne

0

팔로워

0

투표 수

0

댓글


Dustin Swayne님이 에 댓글을 입력함

커뮤니티 댓글 Q&A - Help center and community

The following worked for me where the subject field was number 14 in my array of fields:  props.requestForm.ticket_fields[14].type = "hidden";

 

I'm having trouble doing this for the following though:

props.requestForm.cc_field.type = "hidden";  This doesn't seem to work the same.  Any ideas on how hide the cc field on certain forms?

댓글 보기 · 2024년 11월 18일에 게시됨 · Dustin Swayne

0

팔로워

0

투표 수

0

댓글


Dustin Swayne님이 에 댓글을 입력함

커뮤니티 댓글 Feedback - Ticketing system (Support)

I was able to get this to work in earlier versions of the Copenhagen template but with the latest version it looks like they are using dropdown combo boxes and list boxes to display the options and it is no longer using the ul or li options.  Has anyone found a fix for the version 4 template with these changes?   Ifra Saqlain 

 

댓글 보기 · 2024년 10월 24일에 게시됨 · Dustin Swayne

0

팔로워

0

투표 수

0

댓글


Dustin Swayne님이 에 댓글을 입력함

커뮤니티 댓글 Q&A - Help center and community

Ifra Saqlain any luck on being able to set min or max date range with the date picker in the form?

댓글 보기 · 2024년 6월 12일에 게시됨 · Dustin Swayne

0

팔로워

0

투표 수

0

댓글


Dustin Swayne님이 에 댓글을 입력함

커뮤니티 댓글 Q&A - Help center and community

Was able to fix it by adding these two lines after the alert:

 

$('.datepicker').val(''); // Optionally clear the invalid input
$('#request_custom_fields_2xxxxxx').val('');

 

댓글 보기 · 2024년 5월 07일에 게시됨 · Dustin Swayne

0

팔로워

0

투표 수

0

댓글


Dustin Swayne님이 에 댓글을 입력함

커뮤니티 댓글 Q&A - Help center and community

@Ifra Saqlain 

I was able to get the following to work, however, I cannot clear the date after alert automatically.  Any thoughts?

 

$(document).on('change', 'input.datepicker', function() {
    // Check if the related field value is "rent_increase"
    if ($("#request_custom_fields_2xxxxxx").val() == "xxx_xxxx") {  
        var inputDateString = $(this).val(); // Fetch the input value

        // Parse the input date string assuming format "Month day, year"
        var parts = inputDateString.match(/(\w+) (\d+), (\d+)/);
        if (!parts) {
            alert('Invalid date format. Please enter a date in the format "Month day, year" (e.g., "May 4, 2024").');
            $(this).val(''); // Clear the input if the format is not correct
            return; // Exit the function if the format is incorrect
        }

        // Create a Date object from the parsed date string
        var inputDate = new Date(parts[3], new Date(Date.parse(parts[1] + " 1, 2012")).getMonth(), parts[2]);

        // Set today's date with time reset to midnight for accurate comparison
        var today = new Date();
        today.setHours(0, 0, 0, 0);

        // Calculate the date 60 days from today
        var sixtyDaysFromToday = new Date(today);
        sixtyDaysFromToday.setDate(today.getDate() + 60);

        // Compare the input date to the date 60 days from today
        if (inputDate > sixtyDaysFromToday) {
            console.log('The selected date is greater than 60 days from today.');
        } else {
            alert('Please select a date that is more than 60 days from today.');
            datepicker.setDate(null) // Optionally clear the invalid input
        }
    }
});

댓글 보기 · 2024년 5월 07일에 게시됨 · Dustin Swayne

0

팔로워

0

투표 수

0

댓글


Dustin Swayne님이 에 댓글을 입력함

커뮤니티 댓글 Q&A - Help center and community

Ifra Saqlain Trying to set the minDate of the calendar to 60+ days from today's date so that no dates prior to 60 days out can be selected.  Is this possible with javascript or is it something with pikaday?

 

Thanks for your help in advance.

댓글 보기 · 2024년 4월 21일에 게시됨 · Dustin Swayne

0

팔로워

0

투표 수

0

댓글


Dustin Swayne님이 에 댓글을 입력함

커뮤니티 댓글 Q&A - Help center and community
@Ifra Saqlain When I use the following it shows another calendar and doesnt effect the popup calendar, I'm not sure what the selector should be.:  

document.addEventListener('DOMContentLoaded', function() {

var datePicker = $("#new_request > div.form-field.string.required.request_custom_fields_1");


    // Initialize the datepicker with debugging
    datePicker.datepicker({
      minDate: +60, // 20 days in the past
      maxDate: "", // 1 month and 10 days in the future
      onSelect: function(selectedDate) {
        console.log("Selected date: " + selectedDate);
      }
    });

    // Debugging: Log the current settings to verify
    console.log("Datepicker minDate: ", datePicker.datepicker("option", "minDate"));
    console.log("Datepicker maxDate: ", datePicker.datepicker("option", "maxDate"));
    
})

댓글 보기 · 2024년 4월 17일에 게시됨 · Dustin Swayne

0

팔로워

0

투표 수

0

댓글


Dustin Swayne님이 에 댓글을 입력함

커뮤니티 댓글 Q&A - Help center and community

Ifra Saqlain I tried using the following per your link and its not setting the restrictions.  

댓글 보기 · 2024년 4월 17일에 게시됨 · Dustin Swayne

0

팔로워

0

투표 수

0

댓글