It looks like you're new here. If you want to get involved, click one of these buttons!
http://www.highlandcoffeeroastery.co.za/auth/userprofile
http://highlandcoffeeroastery.co.za/new/auth/userProfile
$page_init = array('location' => 'auth/change_email_form');
$this->load->module_library(FUEL_FOLDER, 'fuel_page', $page_init);
$this->fuel_page->render();
$('#changeEmail').click(function() {
var password = $('#password').val();
var email = $('#email').val();
$.ajax({
type: "POST",
url: "<?php echo base_url(); ?>auth/change_email",
data: {password: password, email: email},
success: function(data){
$('#emailResult').html(data);
}
});
return false;
});
Comments
What's in auth/change_email_form.php?
Yes I mean HTML header/footer.
The change_email_form code:
<div id="emailResult"> <?php $password = array( 'name' => 'password', 'id' => 'password', 'size' => 30, ); $email = array( 'name' => 'email', 'id' => 'email', 'value' => set_value('email'), 'maxlength' => 80, 'size' => 30, ); $attr = array('class'=>'form'); echo form_open($this->uri->uri_string(), $attr); ?> <div class="field"> <?php echo form_label('Password', $password['id']); echo form_password($password); echo '<div class="error">'; echo form_error($password['name']); echo isset($errors[$password['name']])?$errors[$password['name']]:''; echo '</div>'; ?> </div> <div class="field"> <?php echo form_label('New email address', $email['id']); echo form_input($email); echo '<div class="error">'; echo form_error($email['name']); echo isset($errors[$email['name']])?$errors[$email['name']]:''; echo '</div>'; ?> </div> <?php echo form_submit(array('name'=>'changeEmail', 'class'=>'submit', 'id'=>'changeEmail'), 'Send confirmation email'); echo form_close(); ?> </div> <script type="text/javascript"> $('#changeEmail').click(function() { var password = $('#password').val(); var email = $('#email').val(); $.ajax({ type: "POST", url: "<?php echo base_url(); ?>auth/change_email", data: {password: password, email: email}, success: function(data){ $('#emailResult').html(data); } }); return false; }); </script>
<?php fuel_set_var('layout', ''); ?>
But if I removed this line, I get the whole background image in the view, and nothing else. No form.
I added this to my change_email_form view:
<?php fuel_set_var('layout', ''); ?> <!DOCTYPE html> <html lang="en-US"> <head> <title><?php echo fuel_var('page_title', '')?></title> <meta charset="UTF-8" /> <meta name="ROBOTS" content="ALL" /> <meta name="MSSmartTagsPreventParsing" content="true" /> <meta name="keywords" content="<?php echo fuel_var('meta_keywords')?>" /> <meta name="description" content="<?php echo fuel_var('meta_description')?>" /> <?php echo css('main'); ?> <?php echo css($css); ?> <?php echo js('jquery, main'); ?> <?php echo js($js); ?> <script src="http://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-509de4bb2b73c140"></script> <base href="<?php echo site_url()?>" /> <link rel="shortcut icon" type="image/x-icon" href="<?php echo site_url(); ?>favicon.ico" /> </head> <body> ....my form </body> </html>