Forums

Two bugs - Datapickers and RadioBox in DB

siarov 19 Feb, 2013
Hallo
I use V4, Joomla 2.5.9. I have done complicated forms with success. But there is 2 bugs.

First question: I use 2 datepickers – exact like your FAQ - How can I select a range of dates - part 2 (http://www.chronoengine.com/faqs/3161-how-can-i-select-a-range-of-dates-part-2.html).
I have made all like FAQ, all work perfect, but with one bug. When I select start and end dates in 1-st datepicker, Second is starting from the end date of the First. OK till now! But (before sumbit form) if I select another dates on 1-st datepicker, in this case Second is starting only with the dates from first selection. Every another selection on First datepicker not reflect on the Second. I have tried to change code, but without success.

Second question: I have Complicated form with checkboxes, dropdowns and RadioBox with 9 radiobuttons. Read values from Radiobuttons, after that save in DB. All is OK. When I load form again – here is a little bug. Every other elements – checkbox-es, dropdown-s etc. are with the states from DB datas (check or not, dropdown options etc. is OK). But RadioBox is hide. I can not to show it with JS. RadioBox is showing only if it is not connected with the DB.
So, in the DB all is OK, value of the RadioBox (radiobutton) is OK (for example values are 299, 329, 139 etc). I have read 2 days about this on your forums in chronoengine.com, but with no success.

Any idea?
Regards
George
GreyHead 19 Feb, 2013
Hi George,

The code to keep two datepickers in sync gets quite complicated. This code (from the FAQ) should reset the second datepicker if the first one changes
  start_date_dp.addEvent('select', function() {
    if ( typeOf(end_date_dp) == 'object' ) {
      end_date_dp.currentDate = start_date_dp.date;
      end_date.value = '';
    }
  });

Do you see any errors in the JavaScript console?

I don't understand the radio button problem. If the data stored in the DB table matches one of the button values then ChronoForms should re-load it correctly. Do the names of the button group and the database column match exactly?

Bob
siarov 19 Feb, 2013
Thank you for quick reply Bob,
I know this code from FAQ (datepickers) but absolutely strange - it is now work for me.
I have test it many times, but with no success. Code is ablolutely the same like in FAQ.
I will test again. In JS console there is no errors.
For second question: Absolutely strange too. The name of RadioBox is "inp_forms", Radiobuttons are "inp_forms_1 etc." I use variable as var "RadioForms = document.id('inp_forms_container_div')". After thar use Onchane event in Radioforms for manipulation.
In DB all is OK - save all components and value from RadioBox. In opposite - when load form again Radiobox is hide. It is show only when it is no connected with the DB. I will test again, may be error is in my code (2 days I have fight🙂).
I will try again to check where is the problem.
In other case - all other elements are perfect with save/load to DB.

Thank you and Best regards🙂
George
GreyHead 19 Feb, 2013
Hi George,

Please post a link to the form so I can take a quick look.

Bob
siarov 19 Feb, 2013
Thank you Bob, but unfortinately I work now only on my localhost - my PC.
Till the end of the week or in the first days of the next week we must present new website (this form is in the site) (<!-- w --><a class="postlink" href="http://www.sgem.org">www.sgem.org</a><!-- w -->, now this is old site) and then I will link you all.

Best regards
George
siarov 19 Feb, 2013
Hi again Bob🙂
All is OK with the RadioBox - the problem was in the names - must be exactly names.
Thank you for you help
George
This topic is locked and no more replies can be posted.