lundi 2 mars 2015

js submitform() don't send post variables

I am trying to implement in my website a preview page of the profile of the users. This preview page simple load the forms variables and print a fake page of the profile displaying the variables at the actual values. The part of the code where I call the form is



<form id="personal-information-form" method="post" enctype="multipart/form-data">
<h2><?php echo __('Username','Project'); ?>:</h2>
<p><input type="text" size="35" value="<?php echo $user->user_login; ?>" disabled="disabled" class="do_input" /></p>
<script type="text/javascript">
function submitForm(action)
{
document.getElementById('personal-information-form').action = action;
document.getElementById('personal-information-form').setAttribute("target", "_blank");
document.getElementById('personal-information-form').submit();
}

</script>

<h2>&nbsp;</h2>
<p><input type="submit" name="save-info" class="my-buttons" onclick="submitForm('<?php echo $prw_url ?>')" value="<?php _e('Preview' ,'Project'); ?>" />&nbsp;

<input type="submit" name="save-info" class="my-buttons" value="<?php _e('Save' ,'Project'); ?>" /></p>
</form>


If I run the code above locally, the preview page is perfectly visualized. Once I upload the code in the server the preview page does not load the post variables. Which kind of the problem if this? I have no idea where is the problem.


Aucun commentaire:

Enregistrer un commentaire