Hello. if we enable the "modal" contact, all works fine except that it only works if the user doesn't make the validation fail. For example, if he leave blank a required field, we land on a white page without any message. So i consider this feature can't be used in a production site for the moment - a bit to late for me; already on a production site :-).
How can i solved this issue ?

Comments

nyl_auster’s picture

I add this to lightbox2.module for the moment. For those who have this problem, juste copy / paste this function and put it line 1323. You can put anywhere else but this line is just below the first hook form_alter().

function lightbox2_form_contact_mail_page_alter(&$form, $form_state, $form_id = "contact_mail_page"){
  (arg(1) == 'lightbox2') ? $form['#action'] = url('contact') : '';
}

In case of wrong adress e-mail or a error from a field required, it will redirect you to the classic page of contact. I don't know how to ouput error right in the modal box but at least this function makes work normally the validation process and users will see the normal contact form only if a validation error message appear.

Anonymous’s picture

Thanks nyl auster

I have been working on this for about 3 hours now.

Exploratus’s picture

Thanks. This worked great!. Now if we could only get it to work within the lightbox, that would be the icing on top of the cake...

sanjay128yadav’s picture

This code is helpful:

function lightbox2_form_contact_mail_page_alter(&$form, $form_state, $form_id = "contact_mail_page"){
  (arg(1) == 'lightbox2') ? $form['#action'] = url('contact') : '';
}