Sumit Bansal Blog

How to validate email id in javascript 0

How to validate email id in javascript

Find the below code by which you can validate the email field using java-script on client side, var reg = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/; if(!reg.test(document.getElementById(“email”).value)){ alert(“Please fill email address in correct format”); document.getElementById(’email’).focus(); return false; }

How to export Email List from cpanel using javascript and firebug 0

How to export Email List from cpanel using javascript and firebug

To export the email address with the help of java-script: Login your cpanel and select the Email Accounts under the Mail section and change the result per page to show all the emails. Now...

Mysql if condition in update query 0

Mysql if condition in update query

We can use the IF CONDITION in update query, given blow example will show how we can use the IF Condition in update query. Suppose we have a table that has 2 column first...

Add/Remove unwanted links from wordpress admin bar 0

Add/Remove unwanted links from wordpress admin bar

Remove links from wordpress admin bar: Given below code remove the wordpress logo and other links from the admin bar. function annointed_admin_bar_remove() { global $wp_admin_bar; /* Remove their stuff */ $wp_admin_bar->remove_menu(‘wp-logo’); $wp_admin_bar->remove_menu(‘updates’); $wp_admin_bar->remove_menu(‘view-site’); $wp_admin_bar->remove_menu(‘new-link’);...

Remove unwanted menu/submenu links from wordpress dashboard 0

Remove unwanted menu/submenu links from wordpress dashboard

Remove menu page links: function remove_menus() { global $submenu; remove_menu_page( ‘link-manager.php’ ); // Links remove_menu_page( ‘edit-comments.php’ ); // Comments remove_menu_page( ‘themes.php’ ); // Appearance remove_menu_page( ‘plugins.php’ ); // Plugins remove_menu_page( ‘users.php’ ); // Users...

Get customize categories in wordpress 0

Get customize categories in wordpress

The following example will show the categories with checkbox <?php $args=array( ‘child_of’ => ‘1’, ‘hide_empty’ => ‘0’ ); $categories = get_categories($args); foreach($categories as $key => $value){ ?> <label><input name=”escorts_category[]” value=”<?php echo $categories[$key]->cat_ID; ?>” type=”checkbox”>...