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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:27:43+00:00 2026-06-15T11:27:43+00:00

In my php project i have a javascript variable say addText which contains the

  • 0

In my php project i have a javascript variable say “addText” which contains the following html content

<div class="foxcontainer" style="width:100% !important;">
<h2>FREE IN HOME CONSULTATION</h2>

<ul class="fox_messages">
    <li>Invalid field: Your name</li>
    <li>Invalid field: Your email</li>
</ul>

<form enctype="multipart/form-data" class="foxform" action="/hima/bigriglawgroup/index.php/about-us#mid_131" method="post">
<!-- mod_foxcontact 2.0.19 GNU/GPLv3 -->
<div class="foxfield">
    <input class="invalidfoxtext" value="Your name" title="Your name" style="width:85% !important;display:block;float:none;margin:0 auto !important;" name="_c31f7a92d344f9a5c23d07fd438ba0b6" onfocus="if(this.value==this.title) this.value='';" onblur="if(this.value=='') this.value=this.title;" type="text"> 
    <span class="asterisk"></span>
</div>
<div class="foxfield">
    <input class="invalidfoxtext" value="Your email" title="Your email" style="width:85% !important;display:block;float:none;margin:0 auto !important;" name="_4fd8a7bb907c63baca708086b63eb7f0" onfocus="if(this.value==this.title) this.value='';" onblur="if(this.value=='') this.value=this.title;" type="text"> 
    <span class="asterisk"></span>
</div>
<div class="foxfield">
    <input class="validfoxtext" value="Phone number" title="Phone number" style="width:85% !important;display:block;float:none;margin:0 auto !important;" name="_68a05eb930e9ce854ed0c2d2d25c14a1" onfocus="if(this.value==this.title) this.value='';" onblur="if(this.value=='') this.value=this.title;" type="text">
</div>
<div class="foxfield">
    <textarea rows="" cols="" class="validfoxtext" name="_0ef408e84316ef5737db72a727579f48" title="Notes" style="width:85% !important;height:180px !important;display:block;float:none;margin:0 auto !important;" onfocus="if(this.value==this.title) this.value='';" onblur="if(this.value=='') this.value=this.title;">retret ret ret ret</textarea>
</div>
<div class="foxfield">
    <button class="foxbutton" type="submit" style="margin-right:32px;" name="mid_131">
    <span>Submit</span>
    </button>
</div>
<div class="fox-copyright" style="padding:10px 0 !important;text-indent:0 !important">
    <a target="_blank" title="Joomla contact form" href="#" style="display: none !important; display: inline !important; font-size:10px !important;">powered  by fox contact</a>
</div>

</form>

</div>

here I want to check the string “Invalid field” is present or not in that content. If it’s not present I want to do some other functionality.But I don’t know How to do this

Does any one know this ? Please help me ASPS.

Thanks in advance

  • 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-15T11:27:44+00:00Added an answer on June 15, 2026 at 11:27 am
    if (addText.indexOf("Invalid field") != -1) { /* it's present */ }
    
    // OR with regex
    
    if (/Invalid field/.test(addText)) { /* it's present */ }
    
    // OR with case-insensitve regex:
    
    if (/Invalid field/i.test(addText)) { /* it's present */ }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently working on a php/html/javascript project. I have a form where when
I am currently working on a fun project, which involves Ajax, HTML, JavaScript, PHP
I have a PHP project with mix of HTML and JavaScript. PHP scripts are
I have one project with is developed in Php and javascript. How to open
I have implement the exact same concept for my project- http://blog.perplexedlabs.com/2009/05/04/php-jquery-ajax-javascript-long-polling/ My question is,
I have a PHP project where I also have Jasmine JavaScript tests. How can
I am currently working on a php/javascript project which retrieves information from a database
In my php + javascript project i have to show images and some of
I am currently working on a javascript and php project. I have a checkbox
In my PHP project I have two different models that have a function with

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.