|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
bbshetan Smarty n00b
Joined: 14 Jun 2009 Posts: 3
|
Posted: Sun Jun 14, 2009 2:43 pm Post subject: javascript |
|
|
Bonjour, j'ai un petit soucis avec un code javascript et smarty
le code sans smarty (en html ou php) fonctionne très bien mais avec smarty il est pas pris en compte je dois faire une erreur quelque part pouvez vous m'aider s'il vous plait.
Ce code javascript sert a transformé un input text en password.
Voici une partie du code dans fichier index.tplt
Code: | {literal}
<script type="text/javascript">
<!--
function vider() {
document.getElementById('pseudo').value='';
// pour Firefox
//document.getElementById('password').value='';
//document.getElementById('password').type='password';
// pour IE
document.getElementById('div1').innerHTML = '<input type="password" id="password" value="" />';
}
function reinitialiser()
{
if(document.getElementById('pseudo').value == '')
{
document.getElementById('pseudo').value='Pseudo';
//document.getElementById('password').type='text';
//document.getElementById('password').value='Mot de passe';
document.getElementById('div1').innerHTML = '<input type="text" id="password" value="Mot de passe" />';
}
}
-->
</script>
{/literal}
==========
<form action='login.php' method='post'>
<input style="vertical-align:middle;" type='checkbox' name='persistent' value='1' id='rememberme'> <label style="color:#98a9ca; margin-right:70px; vertical-align:middle; cursor:pointer;" for='rememberme'>{lang_print id=660}</label> <a style="color:#98a9ca; margin-right:65px; " href="lostpass.php">{lang_print id=675}</a>
<br>
<input type='text' class='text_index' id="pseudo" name='email' size='23' maxlength='100' value='{lang_print id=10000}'onclick="vider()" onblur="reinitialiser()" />
<input type='text' class='text_index' name='password' id="password" size='23' maxlength='100'value="{lang_print id=10001}">
<input type='submit' class='button_index' value='{lang_print id=30}'>
<NOSCRIPT><input type='hidden' name='javascript_disabled' value='1'></NOSCRIPT>
<input type='hidden' name='task' value='dologin'>
<input type='hidden' name='ip' value='{$ip}'>
</form> |
ce script passe nickel sous firefox et IE sans la template smarty et avec smarty il est pas pris en compte
Merci pour votre aide |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|