Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Pop-up javascript conditionnelle

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: French
View previous topic :: View next topic  
Author Message
petitescarabée
Smarty n00b


Joined: 08 Jul 2008
Posts: 3

PostPosted: Thu Sep 11, 2008 3:34 pm    Post subject: Pop-up javascript conditionnelle Reply with quote

Bonjour à tous,

J'ai un gros gros problème avec Smarty qui demande d'être résolu, alors je me tourne vers vous Smile

J'ai une zone de text (textarea), 4 radiobox (A, B, C, D), et un bouton "submit".
Quand un utilisateur clique sur le bouton, si par exemple C est sélectionnée et que la zone de texte est vide, une fenêtre de popup Javascript affiche un message ; pour d'autres cas, les informations sont envoyées normalement.

Mais pour le moment, je n'ai même pas encore réussi à afficher une pop-up sans condition.

Voici mon code dans le tpl :

Code:
<form method="post" id="execSetResults" name="execSetResults" onSubmit="javascript:return validateStatus();">

<table border="0" width="100%">
        <tr>
           <td rowspan="2" align="center">
              <div class="title">{lang_get s='test_exec_notes'}</div>
              <textarea {$input_enabled_disabled} class="tcDesc" name='notes[{$tcversion_id}]'
                 rows="10" style="width:99%"></textarea>         
           </td>
           <td valign="top" style="width:30%">         
                {* status of test *}
               <div class="title" style="text-align: center;">{lang_get s='test_exec_result'}</div>
                
                <div class="resultBox">
 
                {foreach key=verbose_status item=locale_status from=$gsmarty_tc_status_for_ui}
                      <input type="radio" {$input_enabled_disabled} name="status[{$tcversion_id}]"
                         value="{$gsmarty_tc_status.$verbose_status}"
                         {if $gsmarty_tc_status.$verbose_status eq $gsmarty_tc_status.$default_status}
                         checked="checked"
                         {/if} />{lang_get s=$locale_status}<br />
                    {/foreach}      
                   <br />      
                    <input type="submit" name="save_results[{$tcversion_id}]"
                      {$input_enabled_disabled}
                            value="{lang_get s='btn_save_tc_exec_results'}" />
                </div>
             </td>
          
          </tr>

        </table>


</form>

Code:

{literal}
<script type="text/javascript">
{/literal}

var msg="{lang_get s='warning_delete_execution'}";
var warning_empty_note_for_cancel ="{lang_get s='warning_empty_note_for_cancel'}";

{literal}
function validateStatus()
{

    window.alert(warning_empty_note_for_cancel);
    return false;

  return true;
}

</script>
{/literal}


La course est lancée Embarassed
Merci d'avance !
Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: French All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP