-
Simple Alert
I have this script.
<script type='text/javascript'>
$("li:has(div.err_msgs ul li) label").css('color', '#f00');
</script>
and when it runs it turns the label red - just like its supposed to.
Now i want to add an alert that says, if it runs, then open alert box that says, 'you've missed a required field'
any ideas?
-
I would try
HTML Code:
<script type='text/javascript'>
$("li:has(div.err_msgs ul li) label").css('color', '#f00');
{
alert("you've missed a required field")
return false;
}
</script>
-
i'll give it a try tomorrow and let you know. Thank you very much!
-
yeah, that didn't work. it says, 'return is not a function'?
$("li:has(div.err_msgs ul li) label").css('color', '#f00');
{
alert("You've missed a required field.")
return false;
}
-
$("li:has(div.err_msgs ul li) label").css('color', '#f00');
{
alert("You've missed a required field.")
}
This works, but it loads an alert everytime you load the page. and it should only happen when err_msgs is active.
-
This is how i solved it. Thanks for your help James
$("li:has(div.err_msgs ul li) label").css('color', '#f00');
if($("li:has(div.err_msgs ul li) label").length > 0)
{
alert("You've missed a required field.");
}
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
|
Bookmarks