Hi, i have two datepicker fields: id => "daterit" and "datecon".
In "datecon" i set the function "On date selected" -> controldiffdate().
The function controldiffdate is trigged, but if i try to get the value in this function of one datepicker don't go.
Why? can you help me?
thanks
In "datecon" i set the function "On date selected" -> controldiffdate().
The function controldiffdate is trigged, but if i try to get the value in this function of one datepicker don't go.
function controldiffdate() {
alert(document.getElementById('datarit').value);
alert($("#datecon").val());
}
the alert get empty response.
Why? can you help me?
thanks
hi pirosoft,
Please post a link to the form so I can take a quick look.
Bob
Please post a link to the form so I can take a quick look.
Bob
Hi pirosoft,
I can't see how you are loading the script - if I look at the form without the template then it does not appear at all.
Do you have the script in a Load JavaScript action in the form?
Bob
I can't see how you are loading the script - if I look at the form without the template then it does not appear at all.
Do you have the script in a Load JavaScript action in the form?
Bob
is at the end of template:
<script>
function controldiffdate() {
alert($('#datarit').data("DateTimePicker"));
/* var ritStr = $("#datarit").gdatetimepicker.val().split('-');
var dStr = ritStr[2]+"-"+ritStr[1]+"-"+ritStr[0];
alert(dStr);
var d = new Date(dStr);
var newDStr = d.toString();
alert(newDStr);*/
}
</script>
<script>
function controldiffdate() {
alert($('#datarit').data("DateTimePicker"));
/* var ritStr = $("#datarit").gdatetimepicker.val().split('-');
var dStr = ritStr[2]+"-"+ritStr[1]+"-"+ritStr[0];
alert(dStr);
var d = new Date(dStr);
var newDStr = d.toString();
alert(newDStr);*/
}
</script>
Hi Pirosoft,
It looks as if it is working correctly now - maybe a cache problem??
You don't need to have that in the template and load it on every page. Please transfer the script to a Load JavaScript action in the form.
Bob
It looks as if it is working correctly now - maybe a cache problem??
You don't need to have that in the template and load it on every page. Please transfer the script to a Load JavaScript action in the form.
Bob
Hi,
The calendar element in v6 has an easy format string in the settings, I suggest that you build this form in v6 and keep your existing forms in v5
Best regards,
Max
The calendar element in v6 has an easy format string in the settings, I suggest that you build this form in v6 and keep your existing forms in v5
Best regards,
Max
This topic is locked and no more replies can be posted.