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 6792445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:58:13+00:00 2026-05-26T17:58:13+00:00

Im trying to get this function to validate against the values of 2 inputs

  • 0

I”m trying to get this function to validate against the values of 2 inputs field; namely letters and website but it won’t work and I don’t know what I’m doing wrong.

/* Function */

function access()
{
if(document.getElementById('letters').value=='man' && ('website').value=='mann')location.href='http://www.google.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 */

<div id="cliente">

<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>      

</div><!-- End Cliente -->
  • 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-26T17:58:14+00:00Added an answer on May 26, 2026 at 5:58 pm

    It might just be a copy-paste error from when you posted your question, but this line is wrong:

    if(document.getElementById('letters').value=='man' && ('website').value=='mann') location.href='http://www.google.com'
    // ----------------------------------problem is here--^
    

    You’ve got ('website').value where you should have document.getElementById('website').value

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to get this to work for sometime now: <input id=usr_login_attp value=ok /> function
i am trying this code to validate a date but i get false. what
Trying to get this form to validate email using the function the professor said
Trying to get this to work, with no luck: [DataMember] public Type ParameterType {
I'm trying to get this simple PowerShell script working, but I think something is
I've been trying to get this code to work for hours! All I need
I'm trying to get this css layout to work with IE7 and I'm a
I'm utilizing LightOpenID and I'm trying to get attributes for this gmail authentication but
I'm trying to validate an XML file against an XSD using the function schemaValidate(String
I'm trying to get jQuery validate to work with my radio button form. However,

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.