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

  • Home
  • SEARCH
  • 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 6791485
In Process

The Archive Base Latest Questions

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

This code works fine…though it may be difficult to read. However I want to

  • 0

This code works fine…though it may be difficult to read. However I want to conform to jshint.com, and perhaps make it more readable.

There are so many different ways to change this I don’t know the best way?

Basically I need to be able to turn client_validatin on/off. And if data validates than I make the ajax call to the server.

This felt like a hack when I wrote it, particularly the use of client_fail (i.e. used to determine if the client passed validation.

For this code

function interface_signin()
  {
  var form_name='signin',
      form_elements=document.forms[form_name].elements,
      response_div='signin_response',
      client_fail=0;
  if(arc.client_validation===1)
    {
    (client_fail=1)&&check_empty(form_elements,response_div,messages.empty)&&check_item(patterns.email,form_elements[0],response_div,messages.email)&&check_item(patterns.pass,form_elements[1],response_div,messages.validate)&&(client_fail=0);
    }
    if(client_fail===0){ajax('arche_model.php',serialize(form_name)+'&a=signin',ajax_signin,response_div);}
  }

I get Errors

Line 466: (client_fail=1)&&check_empty(form_elements,response_div,messages.empty)&&check_item(patterns.email,form_elements[0],response_div,messages.email)&&check_item(patterns.pass,form_elements[1],response_div,messages.validate)&&(client_fail=0);

Expected an assignment or function call and instead saw an expression.

  • 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:51:08+00:00Added an answer on May 26, 2026 at 5:51 pm

    This is about how I’d clean it up:

    function interface_signin() {
        var form_elements = document.forms.signin.elements,
            response_div  = 'signin_response',
            client_fail   = false;
    
        if(arc.client_validation === 1) {
            client_fail = check_empty(form_elements, response_div, messages.empty) &&
                          check_item(patterns.email, form_elements[0], response_div, messages.email) &&
                          check_item(patterns.pass, form_elements[1], response_div, messages.validate);
        }
    
        if(!client_fail) {
            ajax('arche_model.php', serialize(form_name) + '&a=signin', ajax_signin, response_div);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

web page : http://sideradesign.com/eco-art/gallery/ This code works fine in all brwosers except IE8 (haven't
Currently, this code works fine in a regular browser window: if (readerObj.Read()) { filename
This code works fine when the user clicks a field. I want it so
This code works fine on browsers other than IE. echo <item> <link>http://www.example.com/showrssdetails.php?id=.$row[recordid].</link> <guid isPermaLink=\true\>http://www.example.com/showrssdetails.php.php?id=.$row[recordid].</guid>
Help! This code works fine on my local VS2010 with TypeMock, however fails on
This code works fine: $result = $client->__call(optionalInfo, array( new SoapParam(..., client), new SoapParam(..., add_code))
this code works fine until I start scrolling: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
This code works fine to find an available room within certain date, but it
This code works fine in C#: Expression.Lambda(LambdaBody); But none of the methods for building
This part of my code works fine: #include <stdio.h> int main(){ //char somestring[3] =

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.