Permalink
Browse files

jquery fixes

  • Loading branch information...
1 parent 6a414f8 commit 6cb4e18ad782e239ea44b1710f1c4b782c56b9be @ryanguill committed Jun 28, 2012
View
@@ -37,13 +37,7 @@ Copyright 2012 Ryan Guill
</cfoutput>
<script type="text/javascript">
- /*
- Event.observe(window, 'load', init, false);
-
- function init() {
-
- }
- */
+
</script>
<style type="text/css">
@@ -59,22 +59,16 @@ Copyright 2012 Ryan Guill
<script type="text/javascript">
- Event.observe(window, 'load', init, false);
-
- function init() {
-
- }
-
function showUpdateRow ( _rowID )
{
- Element.hide('displayRow_' + _rowID);
- Element.show('updateRow_' + _rowID);
+ $('#displayRow_' + _rowID).hide();
+ $('#updateRow_' + _rowID).show();
}
function hideUpdateRow ( _rowID )
{
- Element.show('displayRow_' + _rowID);
- Element.hide('updateRow_' + _rowID);
+ $('#displayRow_' + _rowID).show();
+ $('#updateRow_' + _rowID).hide();
}
</script>
@@ -53,23 +53,17 @@ Copyright 2012 Ryan Guill
</cfoutput>
<script type="text/javascript">
-
- Event.observe(window, 'load', init, false);
-
- function init() {
- }
-
function showUpdateRow ( _rowID )
{
- Element.hide('displayRow_' + _rowID);
- Element.show('updateRow_' + _rowID);
+ $('#displayRow_' + _rowID).hide();
+ $('#updateRow_' + _rowID).show();
}
function hideUpdateRow ( _rowID )
{
- Element.show('displayRow_' + _rowID);
- Element.hide('updateRow_' + _rowID);
+ $('#displayRow_' + _rowID).show();
+ $('#updateRow_' + _rowID).hide();
}
</script>
@@ -37,13 +37,7 @@ Copyright 2012 Ryan Guill
</cfoutput>
<script type="text/javascript">
- /*
- Event.observe(window, 'load', init, false);
-
- function init() {
-
- }
- */
+
</script>
<style type="text/css">
@@ -54,22 +54,16 @@ Copyright 2012 Ryan Guill
<script type="text/javascript">
- Event.observe(window, 'load', init, false);
-
- function init() {
-
- }
-
function showUpdateRow ( _rowID )
{
- Element.hide('displayRow_' + _rowID);
- Element.show('updateRow_' + _rowID);
+ $('#displayRow_' + _rowID).hide();
+ $('#updateRow_' + _rowID).show();
}
function hideUpdateRow ( _rowID )
{
- Element.show('displayRow_' + _rowID);
- Element.hide('updateRow_' + _rowID);
+ $('#displayRow_' + _rowID).show();
+ $('#updateRow_' + _rowID).hide();
}
</script>
@@ -53,63 +53,62 @@ Copyright 2012 Ryan Guill
<script type="text/javascript">
- Event.observe(window, 'load', init, false);
+ $( init );
function init() {
- $('showPasswords').observe('change',showPasswords_onChange);
- $('password2').observe('keyup',checkPasswords);
- $('password').observe('keyup',checkPasswords);
- $('firstname').observe('keyup',onNameChanges);
- $('lastname').observe('keyup',onNameChanges);
- $('password2').observe('blur',checkPasswords);
- $('password').observe('blur',checkPasswords);
- $('firstname').observe('blur',onNameChanges);
- $('lastname').observe('blur',onNameChanges);
+ $('#showPasswords').bind('change',showPasswords_onChange);
+ $('#password2').bind('keyup',checkPasswords);
+ $('#password').bind('keyup',checkPasswords);
+ $('#firstname').bind('keyup',onNameChanges);
+ $('#lastname').bind('keyup',onNameChanges);
+ $('#password2').bind('blur',checkPasswords);
+ $('#password').bind('blur',checkPasswords);
+ $('#firstname').bind('blur',onNameChanges);
+ $('#lastname').bind('blur',onNameChanges);
showPasswords_onChange();
- $('firstname').focus();
+ $('#firstname').focus();
}
function showPasswords_onChange ( )
{
- if ( $('showPasswords').checked == true )
+ if ( $('#showPasswords').is(':checked') )
{
- $('password').type = 'text';
- $('password2').type = 'text';
+ $('#password').get(0).type = 'text';
+ $('#password2').get(0).type = 'text';
}
else
{
- $('password').type = 'password';
- $('password2').type = 'password';
-
+ $('#password').get(0).type = 'password';
+ $('#password2').get(0).type = 'password';
}
}
function checkPasswords(){
doPasswordsMatch = true;
- if ($('password').value.length > 0 && $('password2').value.length > 0) {
- if ($('password').value != $('password2').value) {
+ if ($('#password').val().length > 0 && $('#password2').val().length > 0) {
+ if ($('#password').val() != $('#password2').val()) {
doPasswordsMatch = false;
}
}
if ( !doPasswordsMatch )
{
- $('password2_cell').addClassName('fail');
+ $('#password2_cell').addClass('fail');
}
else
{
- $('password2_cell').removeClassName('fail');
+ $('#password2_cell').removeClass('fail');
}
}
function onNameChanges ( )
{
- $('username').value = $('firstname').value.toLowerCase() + $('lastname').value.toLowerCase();
+ $('#username').val($('#firstname').val().toLowerCase() + $('#lastname').val().toLowerCase());
}
@@ -37,13 +37,7 @@ Copyright 2012 Ryan Guill
</cfoutput>
<script type="text/javascript">
- /*
- Event.observe(window, 'load', init, false);
-
- function init() {
-
- }
- */
+
</script>
<style type="text/css">
@@ -44,13 +44,7 @@ Copyright 2012 Ryan Guill
</cfoutput>
<script type="text/javascript">
- /*
- Event.observe(window, 'load', init, false);
-
- function init() {
-
- }
- */
+
</script>
<style type="text/css">
@@ -62,14 +62,14 @@ Copyright 2012 Ryan Guill
<script type="text/javascript">
- Event.observe(window, 'load', init, false);
+ $( init );
function init() {
- $('showPasswords').observe('change',showPasswords_onChange);
- $('password2').observe('keyup',checkPasswords);
- $('password').observe('keyup',checkPasswords);
- $('password2').observe('blur',checkPasswords);
- $('password').observe('blur',checkPasswords);
+ $('#showPasswords').bind('change',showPasswords_onChange);
+ $('#password2').bind('keyup',checkPasswords);
+ $('#password').bind('keyup',checkPasswords);
+ $('#password2').bind('blur',checkPasswords);
+ $('#password').bind('blur',checkPasswords);
showPasswords_onChange();
@@ -78,64 +78,62 @@ Copyright 2012 Ryan Guill
function showPasswords_onChange ( )
{
- if ( $('showPasswords').checked == true )
+ if ( $('#showPasswords').is(':checked') )
{
- $('password').type = 'text';
- $('password2').type = 'text';
+ $('#password').get(0).type = 'text';
+ $('#password2').get(0).type = 'text';
}
else
{
- $('password').type = 'password';
- $('password2').type = 'password';
-
+ $('#password').get(0).type = 'password';
+ $('#password2').get(0).type = 'password';
}
}
-
function checkPasswords(){
doPasswordsMatch = true;
- if ($('password').value.length > 0 && $('password2').value.length > 0) {
- if ($('password').value != $('password2').value) {
+ if ($('#password').val().length > 0 && $('#password2').val().length > 0) {
+ if ($('#password').val() != $('#password2').val()) {
doPasswordsMatch = false;
}
}
if ( !doPasswordsMatch )
{
- $('password2_cell').addClassName('fail');
+ $('#password2_cell').addClass('fail');
}
else
{
- $('password2_cell').removeClassName('fail');
+ $('#password2_cell').removeClass('fail');
}
}
function showUpdateUserForm ()
{
- Element.show('updateUserDiv');
- Element.hide('showUpdateUserFormLink');
+ $('#updateUserDiv').show();
+ $('#showUpdateUserFormLink').hide();
}
function hideUpdateUserForm ()
{
- Element.hide('updateUserDiv');
- Element.show('showUpdateUserFormLink');
+ $('#updateUserDiv').hide();
+ $('#showUpdateUserFormLink').show();
}
<cfif variables.availableUserGroups.recordCount>
function showAddGroupToUserForm ()
{
- Element.show('addGroupToUserDiv');
- Element.hide('showAddGroupToUserLink');
+ $('#addGroupToUserDiv').show();
+ $('#showAddGroupToUserLink').hide();
}
function hideAddGroupToUserForm ()
{
- Element.hide('addGroupToUserDiv');
- Element.show('showAddGroupToUserLink');
+ $('#addGroupToUserDiv').hide();
+ $('#showAddGroupToUserLink').show();
}
</cfif>
@@ -52,13 +52,7 @@ Copyright 2012 Ryan Guill
</cfoutput>
<script type="text/javascript">
- /*
- Event.observe(window, 'load', init, false);
- function init() {
-
- }
- */
</script>
<style type="text/css">
@@ -37,13 +37,7 @@ Copyright 2012 Ryan Guill
</cfoutput>
<script type="text/javascript">
- /*
- Event.observe(window, 'load', init, false);
-
- function init() {
-
- }
- */
+
</script>
<style type="text/css">
View
@@ -33,13 +33,7 @@ Copyright 2012 Ryan Guill
</cfoutput>
<script type="text/javascript">
- /*
- Event.observe(window, 'load', init, false);
-
- function init() {
-
- }
- */
+
</script>
<style type="text/css">
View
@@ -64,13 +64,7 @@ Copyright 2012 Ryan Guill
</cfoutput>
<script type="text/javascript">
- /*
- Event.observe(window, 'load', init, false);
-
- function init() {
-
- }
- */
+
</script>
<style type="text/css">
Oops, something went wrong. Retry.

0 comments on commit 6cb4e18

Please sign in to comment.