Posts

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="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

Redirect page using jQuery

You can use following methods to redirect a page using jQuery
window.location.replace("http://www.keredari.com");window.location.href = "http://stackoverflow.com";$(location).attr('href', 'http://www.keredari.com');$(window).attr("location","http://www.keredari.com");

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"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <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" />
          </conditions>
          <action type="Rewrite" url="index.php" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>

</configuration>

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

$('input:radio[name="linkTpye"]').change(function(){if($(this).is(':checked'