[gnome-web-www] Try checking for the POST var within the gnome_username field itself



commit 43eb6a562c6052835e3fc25a822dc2bff481854f
Author: Andrea Veri <av gnome org>
Date:   Thu Jun 6 19:35:02 2019 +0000

    Try checking for the POST var within the gnome_username field itself

 theme/page-apply.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/theme/page-apply.php b/theme/page-apply.php
index 492b456..e893ccc 100644
--- a/theme/page-apply.php
+++ b/theme/page-apply.php
@@ -103,8 +103,8 @@ if (array_key_exists('submit', $_POST)) {
   function toggleBenefitsFields() {
    var gnomeAlias = document.getElementById("gnome_mail_alias");
 
-   document.getElementById("gnome_username").disabled = (!gnomeAlias.checked || !isset($gnome_mail_alias)) ;
-   document.getElementById("gnome_jabber").disabled = (!gnomeAlias.checked || !isset($gnome_mail_alias));
+   document.getElementById("gnome_username").disabled = !gnomeAlias.checked;
+   document.getElementById("gnome_jabber").disabled = !gnomeAlias.checked;
 
    document.getElementById("jabber_label").className = (gnomeAlias.checked ? "" : "disabled-checkbox");
 }
@@ -139,7 +139,7 @@ if (array_key_exists('submit', $_POST)) {
 
 <div class="item benefits">
     <input name="gnome_mail_alias" id="gnome_mail_alias" type="checkbox" onClick="toggleBenefitsFields()" 
<?php echo (isset($gnome_mail_alias) ? 'checked="checked"':'') ;?> /> @gnome.org mail alias
-    <input name="gnome_username" id="gnome_username" type="text" placeholder="What do you want your username 
to be?" value="<?php echo htmlspecialchars($gnome_username);?>" disabled />
+    <input name="gnome_username" id="gnome_username" type="text" placeholder="What do you want your username 
to be?" value="<?php echo htmlspecialchars($gnome_username);?>" <?php echo (isset($gnome_mail_alias) ? 
'checked="checked"':'"disabled"') ;?> />
 </div>
 
 <div class="item benefits">


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]