[vlma-devel] commit: serversadapteradd: Update the form with javascript. (Adrien Grand )

git version control git at videolan.org
Mon Apr 28 17:45:27 CEST 2008


vlma | branch: master | Adrien Grand <jpountz at videolan.org> | Mon Apr 28 16:51:10 2008 +0200| [9a51b925c6dc51233207dfa12bb6a27a961b57a0]

serversadapteradd: Update the form with javascript.

> http://git.videolan.org/gitweb.cgi/vlma.git/?a=commit;h=9a51b925c6dc51233207dfa12bb6a27a961b57a0
---

 .../jsp/servers/serversadapteradd_right.jsp        |   27 ++++++++++++++++++-
 1 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/web/src/main/webapp/WEB-INF/jsp/servers/serversadapteradd_right.jsp b/web/src/main/webapp/WEB-INF/jsp/servers/serversadapteradd_right.jsp
index 7815cf0..9bdcd49 100644
--- a/web/src/main/webapp/WEB-INF/jsp/servers/serversadapteradd_right.jsp
+++ b/web/src/main/webapp/WEB-INF/jsp/servers/serversadapteradd_right.jsp
@@ -7,6 +7,18 @@
     </fmt:message>
 </h1>
 
+<script type="text/javascript">
+function toggleGetSatellite() {
+    var getType = document.getElementById("getTypeSelect");
+    var getSatellite = document.getElementById("getSatelliteTr");
+    if (getType.options[getType.selectedIndex].text != "DVB-S") {
+        getSatellite.style.visibility = "hidden";
+    } else {
+        getSatellite.style.visibility = "visible";
+    }
+}
+</script>
+
 <form method="post">
 <table>
     <tr>
@@ -21,12 +33,18 @@
     <tr>
         <td align="right"><fmt:message key="servers.adapter.add.type" /></td>
         <spring:bind path="serversAdapterAdd.type">
-            <td><select name="type"><option>DVB-S</option><option>DVB-T</option><option>Files-Adapter</option></select></td>
+            <td>
+                <select name="type" id="getTypeSelect" onchange="toggleGetSatellite()">
+                    <option>DVB-S</option>
+                    <option>DVB-T</option>
+                    <option>Files-Adapter</option>
+                </select>
+            </td>
             <td><font color="red"><c:out
                 value="${status.errorMessage}" /></font></td>
         </spring:bind>
     </tr>
-    <tr>
+    <tr id="getSatelliteTr">
         <td align="right"><fmt:message key="servers.adapter.add.satellite" /></td>
         <spring:bind path="serversAdapterAdd.satellite">
             <td>
@@ -47,3 +65,8 @@
 <br />
 <input type="submit" value="<fmt:message key="servers.adapter.add.run" />">
 </form>
+
+<script type="text/javascript">
+toggleGetSatellite();
+</script>
+



More information about the vlma-devel mailing list