One of our ticket types permits scheduling request of resources. Because users have a tendancy to just check the box for the date and not actually change the date - I've been asked to display a verification message after they submit the ticket. The verification message is to have the resource name and date requested.
I have no problem displaying $('#DynamicField_ResourceName').val() -- but dynamic field Dates are in the value_date column of the table, not value_text - and displaying $('#DynamicField_ResourceDate').val() results in undefined. Is there a way with jquery (or other scripting??) to get that information?
Thanks much!
M
Display date DynamicField with jquery - RESOLVED
Moderator: crythias
-
- Znuny expert
- Posts: 213
- Joined: 02 Dec 2010, 16:53
- Znuny Version: 6.0.29
- Real Name: Marc
- Company: National Jewish Health
- Location: Denver, CO
Display date DynamicField with jquery - RESOLVED
Last edited by kruegerM on 26 Jul 2012, 15:19, edited 1 time in total.
-
- Moderator
- Posts: 10170
- Joined: 04 May 2010, 18:38
- Znuny Version: 5.0.x
- Location: SouthWest Florida, USA
- Contact:
Re: Display date DynamicField with jquery
What does view source say?
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
-
- Znuny expert
- Posts: 213
- Joined: 02 Dec 2010, 16:53
- Znuny Version: 6.0.29
- Real Name: Marc
- Company: National Jewish Health
- Location: Denver, CO
Re: Display date DynamicField with jquery
I have no "view source" as this is just an "alert'" window at this point....
How this is setup:
1) i added an 'onclick' to the create button:
<button class="Primary" id="submitRichText" accesskey="g" title="$Text{"Create"} (g)" type="submit" value="$Text{"Create"}" onclick=”doVerify();”>$Text{"Create"}</button>
2) I then setup the alert:
<script type=”text/javascript”>
function doVerify()
{
verStrg = “Resource requested: “ + $(‘#DynamicField_Resource’).val() + “ for the date: “ + $(‘#DynamicField_ResourceDate’).val());
alert(verStrg);
}
</script>
DynamicField_ResourceDate is a 'Date' style ticket dynamic field
My hope was to test the coding before I went all out for an 'OK' 'Cancel' message window.......
How this is setup:
1) i added an 'onclick' to the create button:
<button class="Primary" id="submitRichText" accesskey="g" title="$Text{"Create"} (g)" type="submit" value="$Text{"Create"}" onclick=”doVerify();”>$Text{"Create"}</button>
2) I then setup the alert:
<script type=”text/javascript”>
function doVerify()
{
verStrg = “Resource requested: “ + $(‘#DynamicField_Resource’).val() + “ for the date: “ + $(‘#DynamicField_ResourceDate’).val());
alert(verStrg);
}
</script>
DynamicField_ResourceDate is a 'Date' style ticket dynamic field
My hope was to test the coding before I went all out for an 'OK' 'Cancel' message window.......
-
- Moderator
- Posts: 10170
- Joined: 04 May 2010, 18:38
- Znuny Version: 5.0.x
- Location: SouthWest Florida, USA
- Contact:
Re: Display date DynamicField with jquery
I meant to say, if you view source/inspect element on the rendered date field, you should be able to know what to use in jquery.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
-
- Znuny expert
- Posts: 213
- Joined: 02 Dec 2010, 16:53
- Znuny Version: 6.0.29
- Real Name: Marc
- Company: National Jewish Health
- Location: Denver, CO
Re: Display date DynamicField with jquery - RESOLVED
Thank you - don't know why I didn't look there ... but anyway that told me what I needed - thanks!!
It's the "breakdown" fields:
Example - for field: DynamicField_SubmitDate
you have
DynamicField_SubmitDateUsed (this is the checkbox - just here for reference)
DynamicField_SubmitDateMonth
DynamicField_SubmitDateDay
DynamicField_SubmitDateYear
DynamicField_SubmitDateHour
DynamicField_SubmitDateMinute
It's the "breakdown" fields:
Example - for field: DynamicField_SubmitDate
you have
DynamicField_SubmitDateUsed (this is the checkbox - just here for reference)
DynamicField_SubmitDateMonth
DynamicField_SubmitDateDay
DynamicField_SubmitDateYear
DynamicField_SubmitDateHour
DynamicField_SubmitDateMinute