Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6793331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:05:17+00:00 2026-05-26T18:05:17+00:00

How do I get the function below to automatically take visitors to different URLs

  • 0

How do I get the function below to automatically take visitors to different URLs if the value they enter matches man or woman. E.g. If it matches man, it takes them to URL A while woman takes them to URL B

<script type='text/javascript'>
    
function isAlphabet(elem, helperMsg){
    var alphaExp = /man/;/woman/;
    if(elem.value.match(alphaExp)){
        return true;
    }else{
        alert(helperMsg);
        elem.focus();
        return false;
    }
}

</script>

<form>
Letters Only: <input type='text' id='letters'/>
<input type='button' 
    onclick="isAlphabet(document.getElementById('letters'), 'Letters Only Please')"
    value='Check Field' />
</form>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T18:05:17+00:00Added an answer on May 26, 2026 at 6:05 pm

    After some research and questions here i did is as shown below and it works

    function access()
    {
    if(document.getElementById('letters').value=='stevo' && document.getElementById('website').value=='1080' )location.href='http://www.stevsho.com'
    else if(document.getElementById('letters').value=='woman')location.href='http://www.dynamicdrive.com'
    else if(document.getElementById('letters').value=='cat')location.href='http://www.youtube.com'
    else if(document.getElementById('letters').value=='dog')location.href='http://www.dailymotion.com'
    else alert('Access denied. Try again.')
    
    
    
    form>
    <input type='text' class="clientelog" id='website' value="Website"> </input>
    <input type='text' class="clientelog" id='letters' value="Code" >
    </input>
    <input class="checkerbttn" type='button' onclick='access()' value='show me' ></input>
    </form>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Will the strlen() function below get called just once (with the value stored for
I can't get CSS to apply to the function below. Is it because it's
I'm trying to get the javascript below to automatically update the input field (centimeters)
How to get function's name from function's pointer in C? Edit: The real case
this.String = { Get : function (val) { return function() { return val; }
I am trying to use the http_get function. But I get a undefined reference
I'm trying to use the jQuery get function to render the results of an
I want to consume a web service using jquery's get function. There is no
I have a javascript/jQuery block as a callback after $.get function: function myCallBack(data, textStatus)
I want to get lambda function that will query for items which were submitted

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.