Forums

Submit not working

kyliefun 10 Jul, 2010
Submit does nothing, even with debug on - seeing no results. 😫
This is on 2 almost identical sites - http://peterpan.net.au/index.php?option=com_chronocontact&Itemid=10 and http://www.sentia.net.au/index.php?option=com_chronocontact&Itemid=10.

Joomla 1.5.18 and the latest chronoforms.


and the other funny thing is even though date picker is used for all the dates it only shows for some. BTW is there a way that date picker or manual entry can be done?

These forms were working fine until renamed some of the id's and types and created table for data. The form management screen has the correct table noted next to the form.

This is the last of the form code:
<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 150px;">Email Address</label>
    <input class="cf_inputbox" maxlength="200" size="30" title="" id="text_54" name="parent2_email" type="text" />
  </div>
  <div class="cfclear"> </div>
</div>

<div class="form_item">
  <div class="form_element cf_button">
    <input value="Submit" name="button_57" type="submit" />
  </div>
  <div class="cfclear"> </div>
</div>


This is the autogenerated code:
<?php
   $MyForm =& CFChronoForm::getInstance("Child_Registration");
      if($MyForm->formparams("dbconnection") == "Yes"){
	$user = JFactory::getUser();			
	$row =& JTable::getInstance("chronoforms_Child_Registration", "Table");
		srand((double)microtime()*10000);
		$inum	=	"I" . substr(base64_encode(md5(rand())), 0, 16).md5(uniqid(mt_rand(), true));
	JRequest::setVar( "recordtime", JRequest::getVar( "recordtime", date("Y-m-d")." - ".date("H:i:s"), "post", "string", "" ));
	JRequest::setVar( "ipaddress", JRequest::getVar( "ipaddress", $_SERVER["REMOTE_ADDR"], "post", "string", "" ));
	JRequest::setVar( "uid", JRequest::getVar( "uid", $inum, "post", "string", "" ));
	JRequest::setVar( "cf_user_id", JRequest::getVar( "cf_user_id", $user->id, "post", "int", "" ));
	$post = JRequest::get( "post" , JREQUEST_ALLOWRAW );			
		if (!$row->bind( $post )) {
	JError::raiseWarning(100, $row->getError());
		}				
		if (!$row->store()) {
	JError::raiseWarning(100, $row->getError());
		}
	$MyForm->tablerow["jos_chronoforms_Child_Registration"] = $row;
		}
		?>


Would really appreciate immediate assistance to fix this so form can be submitted and emailed to user and manager.

Thanks in advance.
GreyHead 10 Jul, 2010
Hi kyliefun,

Both form submit OK for me using FireFox - the validation messages are higher up the form so ta failed validation can give the impression of the form not submitting

Bob
kyliefun 10 Jul, 2010
Thanks Bob for your prompt response.

I understand what you mean about the validation messages, but I wasn't getting any debug messages but I at all or validation messages.
Well they only appear when the form submission is successful. Then says all is ok. Unfortunately that is of no use when the form doesn't work.

I now have a couple of odd things occurring:
1. the datepicker only appears for 2 out of six items that it is nominated for, all have this format
<div class="form_item">
  <div class="form_element cf_datetimepicker">
    <label class="cf_label" style="width: 150px;">*Commencement Date</label>
    <input class="cf_datetime required" title="" size="20" id="c1commencedate" name="c1commencedate" type="text" />
  </div>
  <div class="cfclear"> </div>
</div>

2. there is tickboxes for selection of one or more days:
<div class="form_item">
  <div class="form_element cf_checkbox">
    <label class="cf_label" style="width: 150px;">*Daycare Days</label>
    <div class="float_left">
      <input value="Monday" title="" class="radio validate-one-required" id="check10" name="c1days[]" type="checkbox" />
      <label for="check10" class="check_label">Monday</label> <br />
      <input value="Tuesday" title="" class="radio validate-one-required" id="check11" name=" c1days[]" type="checkbox" />
      <label for="check11" class="check_label">Tuesday</label> <br />
      <input value="Wednesday" title="" class="radio validate-one-required" id="check12" name=" c1days[]" type="checkbox" />
      <label for="check12" class="check_label">Wednesday</label> <br />
      <input value="Thursday" title="" class="radio validate-one-required" id="check13" name=" c1days[]" type="checkbox" />
      <label for="check13" class="check_label">Thursday</label> <br />
      <input value="Friday" title="" class="radio validate-one-required" id="check14" name=" c1days[]" type="checkbox" />
      <label for="check14" class="check_label">Friday</label> <br />
    </div>
  </div>
  <div class="cfclear"> </div>
</div>

but weirdly the form will only submit if Monday and one other day is selected, and no validation message appears as only one of the five is required to be selected.
Any ideas as to why and how to fix these would be great.


OTHER QUESTIONS:
A. is there a way to have the date picker able to be used or manual input of a date?
B. is there a way for the confirmation screen to only show the details that are emailed to the email address input on the form?
GreyHead 10 Jul, 2010
Hi kyliefun,

Please check your code carefully.

a) Monday and one other are required because Monday has a different name from the other checkboxes (there's a space in the others that needs to be removed).

b) The datetime fields are not correctly set up in the form configuration. There you have 'child_com_2' but the input name is 'c3commencedate'

c) I clearly see validation error messages like this:[attachment=0]10-07-2010 12-32-32.png[/attachment]

Other questions:
A) Im not sure I understand this. You can use a manual input field but you will need to do very careful validation to make sure that the entries are correct.

B) Yes, but it takes quite a lot of work to write a custom Email Template in PHP.

Bob
kyliefun 10 Jul, 2010
Thanks Bob for being so on the ball.

I don't understand where the child_com_2 is coming from?

And now emails aren't working, but I haven't changed anything there.

And and now when the form is submitted to the redirect article (which has public permissions) now says "You DO NOT have permission to view this page."

I'm confused and frustrated.

Thank you so much for your assistance.
GreyHead 10 Jul, 2010
Hi kyliefun,

The datetime fields are identified in a box at the bottom of the form General tab. I guess that you changed the names after the form was created but these entries weren't updated. You can see them in the JavaScript snippet in the page source that sets up the list of date time fields.

The 'No Access" message appears to come from the 'Frontend-User-Access' extension, not from ChronoForms.

No idea about the Emails, if you turn debug back on we might get a clue.

Bob
eric1980 11 Jul, 2010
Thanks for the info Bob, this was helpful to me as well.
kyliefun 12 Jul, 2010
Hi Bob

Thanks so much for your assistance it is great and really appreciated.

I missed the date settings in the general tab completely, but have now corrected them and works.

With the emails - what is interesting is that on one site (sentia) they work perfectly and on the other (peterpan) they don't work at all. I have now checked all the tabs in form maintenance between the sites and they are all the same. The global configs are the same on both sites. Now I have just tweaked the formating of the email template for both sites and low and behold the Peter pans emails work again. Very strange.


ERIC 1980
I'm glad this info also helped someone else too.

Again thankyou for your prompt and accurate assistance.
This topic is locked and no more replies can be posted.