Sunday, March 26, 2023
Learning Code
  • Home
  • JavaScript
  • Java
  • Python
  • Swift
  • C++
  • C#
No Result
View All Result
  • Home
  • JavaScript
  • Java
  • Python
  • Swift
  • C++
  • C#
No Result
View All Result
Learning Code
No Result
View All Result
Home JavaScript

Adding class if div is empty – JavaScript – SitePoint Forums

learningcode_x1mckf by learningcode_x1mckf
November 9, 2022
in JavaScript
0
Time limit for notify – JavaScript – SitePoint Forums
74
SHARES
1.2k
VIEWS
Share on FacebookShare on Twitter


You might also like

Hackers Inject Weaponized JavaScript (JS) on 51,000 Websites – GBHackers

4 Ways to Remove a Specific Item From a JavaScript Array – MUO – MakeUseOf

Toolkit Allows JavaScript Devs to Program Embedded Devices – The New Stack

im growing php kind for electronic mail with ajax in order that web page doesnt should refersh.

<kind class="get-form" methodology="put up" motion="get-quote.php">
    <div class="text-center form-fill">
       <h4 class="output_message" id="message"></h4>
    </div>
   //form-field
</kind>

After kind have been efficiently submitted message will probably be displayed in “H4.output_message”. with following ajax code.

$(doc).prepared(perform() {
    $('.get-form').on('submit',perform()
         
        // Add textual content 'loading...' proper after clicking on the submit button. 
        $('.output_message').textual content('Loading...'); 
         
        var kind = $(this);
        $.ajax(
            url: kind.attr('motion'),
            methodology: kind.attr('methodology'),
            information: kind.serialize(),
            success: perform(end result)
                $("kind")[0].reset();
                if (end result == 'success')
                    $('.output_message').textual content('Message Despatched!');  
                 else 
                    $('.output_message').textual content('Error Sending electronic mail!');
                
            
        );
          return false;   
    );
});

Every thing works wonderful however i need conceal “div.form-fill” when h4.out_message is empty as i’ve performed some css styling. i need to show “div.form-fill” solely when h4.out_message have some textual content.
Works wonderful with JavaScript however couldn’t work out with ajax



Source link

Share30Tweet19
learningcode_x1mckf

learningcode_x1mckf

Recommended For You

Hackers Inject Weaponized JavaScript (JS) on 51,000 Websites – GBHackers

by learningcode_x1mckf
March 25, 2023
0
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

Hackers Inject Weaponized JavaScript (JS) on 51,000 Websites  GBHackers Source link

Read more

4 Ways to Remove a Specific Item From a JavaScript Array – MUO – MakeUseOf

by learningcode_x1mckf
March 24, 2023
0
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

4 Ways to Remove a Specific Item From a JavaScript Array  MUO - MakeUseOf Source link

Read more

Toolkit Allows JavaScript Devs to Program Embedded Devices – The New Stack

by learningcode_x1mckf
March 23, 2023
0
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

Toolkit Allows JavaScript Devs to Program Embedded Devices  The New Stack Source link

Read more

Select data value from grandparent div? – JavaScript – SitePoint

by learningcode_x1mckf
March 23, 2023
0
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

Select data value from grandparent div? - JavaScript  SitePoint Source link

Read more

How to Handle Errors in JavaScript – Programming – MUO – MakeUseOf

by learningcode_x1mckf
March 23, 2023
0
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

How to Handle Errors in JavaScript - Programming  MUO - MakeUseOf Source link

Read more
Next Post
SE Asia Report: LSD now confirmed in Central Java

SE Asia Report: LSD now confirmed in Central Java

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Related News

Common Tools & Java Libraries used at Startups you should know about! (Part # 1) | by Shubham Matta (voidcoder) | Jan, 2023

Common Tools & Java Libraries used at Startups you should know about! (Part # 1) | by Shubham Matta (voidcoder) | Jan, 2023

January 29, 2023
Senior Java Developer at Datonomy Solutions – Gauteng Johannesburg North

Senior Java Developer at Datonomy Solutions – Gauteng Johannesburg North

November 22, 2022
10 little UIKit tips you should know

10 little UIKit tips you should know

September 11, 2022

Browse by Category

  • C#
  • C++
  • Java
  • JavaScript
  • Python
  • Swift

RECENT POSTS

  • 2023 Java roadmap for developers – TheServerSide.com
  • YS Jagan launches Ragi Java in Jagananna Gorumudda, says focused on intellectual development of students – The Hans India
  • Disadvantages of Java – TheServerSide.com

CATEGORIES

  • C#
  • C++
  • Java
  • JavaScript
  • Python
  • Swift

© 2022 Copyright Learning Code

No Result
View All Result
  • Home
  • JavaScript
  • Java
  • Python
  • Swift
  • C++
  • C#

© 2022 Copyright Learning Code

Are you sure want to unlock this post?
Unlock left : 0
Are you sure want to cancel subscription?