It looks like you're new here. If you want to get involved, click one of these buttons!
$vars['form_newsletter'] = $this->fuel->forms->create('newsletter', array(
'fields' => array(
'name' => array('required' => TRUE),
'email' => array('required' => TRUE),
)
));
<?=$form_newsletter->render()?>
Comments
echo 'BOO!!'
just to see what you get.The video is a nice idea but it would help to see the page URL and the console output too
<html><head><script type="text/javascript" charset="utf-8" src="/fuel/modules/fuel/assets/js/jquery/plugins/jquery-migrate-1.1.1.js?c="></script></head></html>
Here's before the form submit, and after: https://imgur.com/a/j4Giy
I'm on the develop branch of FUEL if that matters.
On the newsletter though, I have one more question. I'm linking out to jQuery at the bottom, just before the closing body tag, and printing out the form near the top of the page using the
$this->fuel->forms->create()
helper. Although this helper sends along jquery validate, additional-methods.js, jquery forms, and forms.js alongside some inline js too, which is breaking since jQuery isn't defined yet. Is there anyway to defer these to the footer?I'm using
<?=jquery()?> <?=js($js)?>
in my footer to generate all my javascript
Although now the original issue is back, and I can't see what I've changed. I'm using:
echo form('newsletter');
Although, if I use:
$form = $this->fuel->forms->create('newsletter'); echo $form->render();
Only the "Submit" button is printed out.
If I toggle the "Javascript submit" to no in the admin panel, then it works. If I select yes, then after the form it's just a white page. If you want a live preview just let me know?
<?php $this->load->view('_blocks/sidebar', $sidebar); ?>
$sidebar isn't related to the newsletter, as it's an array of data containing the recent posts, recent comments, etc. that is built up in a controller.
It doesn't refresh, or at least a new history state isn't triggered.