]> ruin.nu Git - ndwebbie.git/blobdiff - root/src/members/ircrequest.tt2
Need to pick channel before sending
[ndwebbie.git] / root / src / members / ircrequest.tt2
index 5c5c8d4b6127d0395e65873e548476644cd587be..dd31bd47a59d5aeb1ea96032e67bc0d79d74d120 100644 (file)
@@ -2,13 +2,27 @@
 [% IF reply %]
 <h3>[% reply %]</h3>
 [% END %]
-<form action="[% c.uri_for('postircrequest') %]" method="post"><fieldset> <legend>Launch confirmation</legend>
+<form action="[% c.uri_for('postircrequest') %]" method="post"><fieldset> <legend>IRC request</legend>
        <p>Message to irc. To def channel you can report incs with a line from gal status.</p>
-       <select name="channel">
+       <input style="width: 90%" type="text" name="message" value="[% ircmessage %]">
+       <br><select name="channel" id="channel">
+       <option value="">Pick a channel</option>
 [% FOR ch IN channels %]
        <option value="[% ch %]">[% ch | ucfirst %]</option>
 [% END %]
        </select>
-       <input type="text" name="message" value="">
-       <br><input type="submit" value="Send">
+       <input type="submit" value="Send" id="ircsend">
 </fieldset></form>
+
+<script type="text/javascript">
+$(document).ready(function(){
+       $("#ircsend").attr("disabled","true");
+       $('#channel').change(function(){
+               var u = $('option:selected');
+               if (u.val() == '')
+                       $("#ircsend").attr("disabled","true");
+               else
+                       $("#ircsend").removeAttr("disabled");
+       });
+});
+</script>