/[Frey]/trunk/static/Frey/Action.js
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/static/Frey/Action.js

Parent Directory Parent Directory | Revision Log Revision Log


Revision 950 - (show annotations)
Tue Jan 6 23:42:59 2009 UTC (15 years, 3 months ago) by dpavlin
File MIME type: application/javascript
File size: 623 byte(s)
radio buttons with free-form enter supported
1 /* Frey::Action */
2
3 /* clear radio buttons */
4 function clear_radio(form_id,name) {
5 console.log( 'clear_radio '+form_id+'.'+name );
6 var form = document.getElementById( form_id );
7 if ( ! form ) console.error( form_id + ' not found' );
8
9 for ( var i = 0 ; i < form[name].length - 1 ; i++ ) {
10 form[name][i].checked = false;
11 }
12 var radio = form[name][ form[name].length - 1 ];
13 if ( ! radio ) console.error( 'last radio button not found' );
14 radio.checked = true; /* free type input radio button */
15
16 var new_value = document.getElementById( 'new-' + name ).value;
17 console.log( new_value );
18 radio.value = new_value;
19 };
20

  ViewVC Help
Powered by ViewVC 1.1.26