yannml Posted September 14, 2012 Share Posted September 14, 2012 Bonjour, Suite a plusieurs tests, mes utilisateurs ont du mal à saisir l'interet de ce champ. J'aimerais pouvoir remplir le champ "donnez un titre a cette adresse" automatiquement avec le nom-prenom saisi juste au dessus. Auriez vous une idée de comment faire ca ? Merci d'avance, Yann Link to comment Share on other sites More sharing options...
yannml Posted September 19, 2012 Author Share Posted September 19, 2012 Une idée du fichier à modifier peut etre ? Link to comment Share on other sites More sharing options...
yannml Posted September 19, 2012 Author Share Posted September 19, 2012 Le fichier a modifier et le authentification.php Voici mes champs prenom, nom et alias <p class="required text"> <label for="customer_firstname">{l s='First name'}</label> <input onkeyup="$('#firstname').val(this.value);" type="text" class="text" id="customer_firstname" name="customer_firstname" value="{if isset($smarty.post.customer_firstname)}{$smarty.post.customer_firstname}{/if}" /> <sup>*</sup> </p> <p class="required text"> <label for="customer_lastname">{l s='Last name'}</label> <input onkeyup="$('#lastname').val(this.value);" type="text" class="text" id="customer_lastname" name="customer_lastname" value="{if isset($smarty.post.customer_lastname)}{$smarty.post.customer_lastname}{/if}" /> <sup>*</sup> </p> <p class="required text" id="address_alias"> <label for="alias">{l s='Assign an address title for future reference'} </label> <input type="text" class="text" name="alias" id="alias" value="{if isset($smarty.post.alias)}{$smarty.post.alias}{else}{l s='My address'}{/if}" /> <sup>*</sup> </p> Par contre, j'arrive pas a afficher le nom (ou encore mieu le "prenom-nom") automatiquement dans le champ Alias Link to comment Share on other sites More sharing options...
franckm1000 Posted September 19, 2012 Share Posted September 19, 2012 Il faut remplacer le champs value du 3 ème input par les champs value des 2 premiers. Link to comment Share on other sites More sharing options...
yannml Posted September 21, 2012 Author Share Posted September 21, 2012 Bonjour Franck et merci pour ta reponse. Si je change le 3eme imput comme ceci par exemple ca ne fonctionne pas, c'est comme ca que tu voyais la chose ? <p class="required text" id="address_alias"> <label for="alias">{l s='Assign an address title for future reference'} </label> <input type="text" class="text" name="alias" id="alias" value="{if isset($smarty.post.customer_lastname)}{$smarty.post.customer_lastname}{/if}" /> <sup>*</sup> </p> Link to comment Share on other sites More sharing options...
yannml Posted September 26, 2012 Author Share Posted September 26, 2012 Salut, Je suis toujours coincé sur ce probleme. Je post le fichier authentification.tpl (renomé en .txt) complet si ca peut aider. authentication.txt Link to comment Share on other sites More sharing options...
jmaumene Posted September 26, 2012 Share Posted September 26, 2012 en javascript : <p class="required text"> <label for="customer_firstname">{l s='First name'}</label> <input onkeyup="$('#firstname').val(this.value);$('#alias').val($('customer_firstname').val()+' '+$('customer_lastname').val());" type="text" class="text" id="customer_firstname" name="customer_firstname" value="{if isset($smarty.post.customer_firstname)}{$smarty.post.customer_firstname}{/if}" /> <sup>*</sup> </p> <p class="required text"> <label for="customer_lastname">{l s='Last name'}</label> <input onkeyup="$('#lastname').val(this.value);$('#alias').val($('customer_firstname').val()+' '+$('customer_lastname').val());" type="text" class="text" id="customer_lastname" name="customer_lastname" value="{if isset($smarty.post.customer_lastname)}{$smarty.post.customer_lastname}{/if}" /> <sup>*</sup> </p> je n'ai pas testé le code Link to comment Share on other sites More sharing options...
yannml Posted September 28, 2012 Author Share Posted September 28, 2012 Bonjour et merci webaide, j'essayé et modifié ton code comme ceci : <p class="required text"> <label for="customer_firstname">{l s='First name'}</label> <input onkeyup="$('#firstname').val(this.value);" type="text" class="text" id="customer_firstname" name="customer_firstname" value="{if isset($smarty.post.customer_firstname)}{$smarty.post.customer_firstname}{/if}" /> <sup>*</sup> </p> <p class="required text"> <label for="customer_lastname">{l s='Last name'}</label> <input onkeyup="$('#lastname').val(this.value);$('#alias').val($('customer_firstname').val()+' '+$('customer_lastname').val());" type="text" class="text" id="customer_lastname" name="customer_lastname" value="{if isset($smarty.post.customer_lastname)}{$smarty.post.customer_lastname}{/if}" /> <sup>*</sup> </p> L'objectif est proche, mais le resultat affiché dans le champs alias est "undefined undefined", et évidement le client ne s'appel pas "undefined" Link to comment Share on other sites More sharing options...
jmaumene Posted September 28, 2012 Share Posted September 28, 2012 (edited) c'est ma faute, il faut rajouter un # devant customer_firstname et customer_lastname comme ceci : <p class="required text"> <label for="customer_firstname">{l s='First name'}</label> <input onkeyup="$('#firstname').val(this.value);$('#alias').val($('#customer_firstname').val()+' '+$('#customer_lastname').val());" type="text" class="text" id="customer_firstname" name="customer_firstname" value="{if isset($smarty.post.customer_firstname)}{$smarty.post.customer_firstname}{/if}" /> <sup>*</sup> </p> <p class="required text"> <label for="customer_lastname">{l s='Last name'}</label> <input onkeyup="$('#lastname').val(this.value);$('#alias').val($('#customer_firstname').val()+' '+$('#customer_lastname').val());" type="text" class="text" id="customer_lastname" name="customer_lastname" value="{if isset($smarty.post.customer_lastname)}{$smarty.post.customer_lastname}{/if}" /> <sup>*</sup> </p> Edited September 28, 2012 by webaide (see edit history) Link to comment Share on other sites More sharing options...
yannml Posted September 28, 2012 Author Share Posted September 28, 2012 Merci beaucoup, ca marche, tu portes bien ton pseudo Webaide ! Encore merci. Link to comment Share on other sites More sharing options...
jmaumene Posted September 28, 2012 Share Posted September 28, 2012 De rien Un petit résolu Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now