Showing posts from July, 2016

get selected radio button value using jQuery

To get the value of the selectedradioName item of a form with id myForm:

$('input[name=radioName]:checked','#myForm').val()Here's an example:$('#myForm input').on('change',function(){ alert($('input[name=radioName]:checked','#myForm').val());});<scriptsrc=""></script>

Redirect page using jQuery

You can use following methods to redirect a page using jQuery
window.location.replace("");window.location.href = "";$(location).attr('href', '');$(window).attr("location","");

Setup WordPress Permalinks on Windows IIS

Create a file web.config under root folder where WordPress has installed and past following code. or download from Github.
<?xml version="1.0" encoding="UTF-8"?>
        <rule name="wordpress" stopProcessing="true">
          <match url=".*" />
          <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
          <action type="Rewrite" url="index.php" />


Redirect to requested page after login in wordpress

Add below code in function.php of your theme.
function my_login_redirect( $redirect_to, $request, $user ) {
//is there a user to check?
if ( isset( $user->roles ) && is_array( $user->roles ) ) {
//check for admins
if ( in_array( 'administrator', $user->roles ) ) {
// redirect them to the default place
return $redirect_to;
} else {
return $request;
} else {
return $request;
add_filter( 'login_redirect', 'my_login_redirect', 10, 3 );

Get value If radio button is checked using jquery