Archive | January 2013

Add Watermark to Textbox using jQuery


jQuery(document).ready(function() {
var watermark = "Type the code seen above";
jQuery(".wpcf7-captchar").val(watermark);
jQuery(".wpcf7-captchar").focus(function() {
if (jQuery.trim(jQuery(".wpcf7-captchar").val()) == watermark) {
jQuery(".wpcf7-captchar").val("");
}
});
jQuery(".wpcf7-captchar").blur(function() {
if (jQuery.trim(jQuery(".wpcf7-captchar").val()) == "") {
jQuery(".wpcf7-captchar").val(watermark);
}
});
});

Contact Form 7 watermark for select menu

Put this code in your functions.php file:

function my_wpcf7_form_elements($html) {
$text = 'Please select...';
$html = str_replace('---', '' . $text . '', $html);
return $html;
}
add_filter('wpcf7_form_elements', 'my_wpcf7_form_elements');

Add User to SQL Server Database

Add User Using Windows Authentication

-- Create user windows Authentication
CREATE LOGIN [YourDomainNameJohnJacobs] FROM WINDOWS
WITH DEFAULT_DATABASE = [YourDatabaseHere];
GO
-- Now add user to database
USE YourDatabaseHere;
CREATE USER JohnJacobs FOR LOGIN [YourDomainNameJohnJacobs];
-- If adding to a second database, do so below:
USE YourSecondDatabaseHere;
CREATE USER JohnJacobs FOR LOGIN [YourDomainNameJohnJacobs];

Add User Using SQL Authentication

-- Create user for SQL Authentication
CREATE LOGIN JohnJacobs WITH PASSWORD = 'JinGleHeimerSchmidt'
,DEFAULT_DATABASE = [YourDatabaseHere]
GO
-- Now add user to database
USE YourDatabaseHere;
CREATE USER JohnJacobs FOR LOGIN JohnJacobs;
GO
-- If adding to a second database, do so below:
USE YourSecondDatabaseHere;
CREATE USER JohnJacobs FOR LOGIN JohnJacobs;

Retina Display Media Query

For including high-res graphics, but only for screens that can make us of them. “Retina” being “2x”:

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { /* Retina-specific stuff here */ }