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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:26:49+00:00 2026-06-11T10:26:49+00:00

Wondering how to add in js script a three more !== or statements. The

  • 0

Wondering how to add in js script a three more !== or statements. The following script was provided as a spectacular answer by jsfriend00 but the problem is I made the mistake of not mentioning there’s three more textareas unaccounted for. I’m stuck with the javascript on the remaining or !== conditions. In the following script how to take say !== to each of the following var obj?

//VIEW FILE for private networking stream between admin and clientele:

 <?php if(!defined('BASEPATH')) exit('No direct script access allowed'); ?>

 <html>
 <title>Chat</title>
 <head>

 <?php echo smiley_js(); ?>

 </head>
 <body>

 <?php echo form_open('controller/function');?>
 Reload chat<?php echo form_submit('reload','reload chat');?>
 <?php echo form_close();?>


 <?php if(isset($user_query)): foreach($user_query->result() as $row):?>

 <p>Created at: <?php echo $row->created_at; ?> </p> 

 <p>Updated at: <?php echo $row->updated_at; ?> </p> 

 <p><label for="update"> <?php echo $username_sess.'&nbsp;said'?>:<span class="optional"></span></label>  

  <textarea name="update" id="update" rows="7" cols="30"><?php echo $row->clt_rep_stream ?></textarea>


  <?php echo form_open('controller/function');?>

  <?php echo form_hidden('user_id',$row->user_id) ?>

  <p><label for="adm_update">reply to client:<span class="optional"></span></label>                                
  <textarea name="adm_update" id="adm_update" rows="7" cols="30"> </textarea>
  <?php echo form_error('adm_update'); ?>
   </p>
   <?php echo form_submit('submit','reply');?>

   <?php echo form_close();?>


   <?php echo form_open('controller/function'); ?>

   <?php echo form_hidden('user_id',$row->user_id) ?>

   <p>Replied at: <?php echo $row->adm_created_at; ?> </p> 

   <p>Updated at: <?php echo $row->adm_updated_at; ?> </p> 

   <p><label for="reupdate"> <?php echo $username_adm_sess.'&nbsp;replied:'?><span class="optional"></span></label>  

   <textarea name="reupdate" id="reupdate" rows="7" cols="30"><?php echo $row->adm_rep_stream ?> </textarea>
   <p>                             
   <?php echo form_submit( 'submit', 'update reply'); ?>
   </p>

  <?php echo form_close(); ?>

  <?php endforeach; ?>

  <?php endif; ?>

   <script>
   function autoRefresh(refreshPeriod) {
   var obj = document.getElementById("create"); 
   var obj_two = document.getElementById("update"); 
   var obj_three = document.getElementById("delete"); 
   var obj_four = document.getElementById("reload"); 

   function refreshIfSafe() {
   if (document.activeElement !== obj) { 
    window.location.reload();
  } else {
    setTimeout(refreshIfSafe, refreshPeriod);
   }
 }
    setTimeout(refreshIfSafe, refreshPeriod);
 }

   autoRefresh(2 * 1000);

   </script>

   </body>
   </html>

I tried the following but didn’t work:

    if(document.activeElement !==(obj || obj_two))

I tried the following after Brad’s post which partially worked but any update or replies after the first two and the following js is rendered null and void which is really confusing:

    if(document.activeElement !== obj && document.activeElement !== obj_two)
  • 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-06-11T10:26:50+00:00Added an answer on June 11, 2026 at 10:26 am

    Each condition is separate. Treat it as such.

    (document.activeElement !== obj) && (document.activeElement !== obj_two) && ...
    

    You could also do this in a loop if your elements weren’t explicitly called out like they are, but I don’t know how this would fit in your code, as I don’t know what your actual code looks like.

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

Sidebar

Related Questions

I am wondering if anyone knows a java script library that would add a
I'm wondering how to add onblur=hcb.watermark.blur(event) onfocus=hcb.watermark.focus(event) style=color: rgb(136, 136, 136); to the following
i'm currently wondering how to add more localizations to my PhoneGap App on the
The following script works well to both truncate a link and add an icon
I am wondering how to add an image to the jquery button. Till now
I was wondering how to add our own custom icon to the web page
I have only used MapRoute and slightly wondering where Routes.Add is used and on
Im wondering how i could add a success or fail message to return at
Hi just wondering whether or not to add a pull to refresh in my
I was wondering about how to add the autocomplete JQuery UI widget to a

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.