Created
March 22, 2013 15:04
-
-
Save markphi2013/5221951 to your computer and use it in GitHub Desktop.
css validation Bug on dialogue and request
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.ttc-validation-error { | |
position: absolute; | |
left: -700px; | |
top: -50px; | |
top: -35px\9; | |
background: pink; | |
border: solid white; | |
padding: 5px; | |
font-size: 12px; | |
} | |
.ttc-radio-validation-error { | |
left: 30px; | |
} | |
.ttc-textarea-validation-error { | |
/* position: relative;*/ | |
/*left: 170px;*/ | |
top : -96px; | |
top: -52px\9; | |
} | |
.ttc-textarea-validation-error.request { | |
left: -695px; | |
} | |
.ttc-textarea-validation-error.dialogue{ | |
left: 191px; | |
top : -113px; | |
top: -59px\9; | |
} | |
.ttc-input-validation-error { | |
top: -49px; | |
top: -64px\9; | |
left: 191px\9; | |
} | |
/*Chrome hack*/ | |
@media screen and (-webkit-min-device-pixel-ratio:0) { | |
.ttc-validation-error{ top: -32px; } | |
.ttc-radio-validation-error{ top: -38px;} | |
.ttc-textarea-validation-error {top: -60px; left: 170px} | |
.ttc-input-validation-error {left: 198px; top: -61px;} | |
.ttc-textarea-validation-error.dialogue {top: -60px} | |
.ttc-textarea-validation-error.request {top: -60px; left: 170px;} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("textarea[name*='content']").each(function (item) { | |
// if($("content[name*='question-answer']")){ | |
if($("textarea[name*= 'interaction[2].content']")){ | |
$(this).rules("add",{ | |
required:true, | |
messages:{ | |
required: wrapErrorMessageInClass(localized_errors.validation_required_content, "ttc-textarea-validation-error dialogue"), | |
} | |
}); | |
}else{ | |
$(this).rules("add",{ | |
required:true, | |
messages:{ | |
required: wrapErrorMessageInClass(localized_errors.validation_required_content, "ttc-textarea-validation-error "), | |
} | |
}); | |
} | |
}); |
when i add 'class' => 'request' to the edit dialogue file this only attaches to request class to the dialogue and so when i select question from the interactions, save with content empty there is no error message cause the dialogue Css class is not presented any where in file.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The the class dialogue or request are add to the element with id=dynamic-generic-program-form
in View/ProgramDialogues/edit.ctp line 51
Html->tag('form', null, array(' id'=> 'dynamic-generic-program-form', 'class' => 'request')); ?>