Arnab Chakraborty has Published 34 Articles

How to validate a form using jQuery?

Arnab Chakraborty

Arnab Chakraborty

Updated on 09-Sep-2023 23:26:40

30K+ Views

At first you have to make a html form like. Validation of a form First name: Last name: Email: Now use jQuery validation plugin to validate forms' data in easier way.first, add jQuery library in your file. then ... Read More

How to process a simple form data using Python CGI script?

Arnab Chakraborty

Arnab Chakraborty

Updated on 09-Sep-2023 23:02:23

3K+ Views

Suppose there is an HTML file as below − FirstName: LastName: After submitting this form it should go to a Python page named "getData.py", where you should fetch the data from this HTML page and show. ... Read More

How can I remove all child elements of a DOM node in JavaScript?

Arnab Chakraborty

Arnab Chakraborty

Updated on 11-Aug-2022 10:45:43

11K+ Views

Suppose you are building a web app that manages the data of daily tasks, the user inserts the task and a list of tasks gets formed. But at some point in time, the user wants to remove all the tasks from the list and wants to make the list empty. ... Read More

How to horizontally center a

Arnab Chakraborty

Arnab Chakraborty

Updated on 22-Dec-2021 06:36:55

212 Views

Here I have one html form and one css file(style.css).”o-div” is the outer div and “i-div“is the inner div class.Example           center a div                              I am OUTER DIV   ... Read More

How to test if a Java String contains a case insensitive regex pattern

Arnab Chakraborty

Arnab Chakraborty

Updated on 24-Jun-2020 07:29:15

215 Views

the syntax? i:x makes the string search case-insensitive. for egpublic class RegCaseSense {    public static void main(String[] args) {       String stringSearch = "HI we are at java class.";       // this won't work because the pattern is in upper-case       System.out.println("Try ... Read More

Java regex to exclude a specific String constant

Arnab Chakraborty

Arnab Chakraborty

Updated on 24-Jun-2020 07:26:33

966 Views

regex ^((?!kk).)*$ returns true if a line does not contain kk, otherwise returns falseExamplepublic class RegTest {    public static void main(String[] args) {       // TODO Auto-generated method stub       String s="tutorials";       boolean i=s.matches("^((?!kk).)*$");       System.out.println(i);    } }

Can someone help me fix this Python Program?

Arnab Chakraborty

Arnab Chakraborty

Updated on 24-Jun-2020 07:26:01

59 Views

The first problem u are getting in the bold portion is due to non-indent block, put one indentation there.second problem is name variable is not definedfollowing is the corrected one -print ("Come-on in. Need help with any bags?") bag=input ('(1) Yes please  (2) Nah, thanks   (3) Ill get em ... Read More

How to use enums in Python classes?

Arnab Chakraborty

Arnab Chakraborty

Updated on 23-Jun-2020 14:47:21

176 Views

There is a module name "enum" in python with the hep of which enum is used in python.#import enum import enum # use enum in class class Car(enum.Enum):    suzuki = 1    Hyundai = 2    Dezire = 3 print ("All the enum values are : ") for c in (Car):    print(c)

Match all occurrences of a regex in Java

Arnab Chakraborty

Arnab Chakraborty

Updated on 23-Jun-2020 14:46:06

160 Views

public class RegexOccur {    public static void main(String args[]) {       String str = "java is fun so learn java";       String findStr = "java";       int lastIndex = 0;       int count = 0;       while(lastIndex != -1) {          lastIndex = str.indexOf(findStr,lastIndex);          if(lastIndex != -1) {             count ++;             lastIndex += findStr.length();          }       }       System.out.println(count);    } }Output2

What e.preventDefault() method really does in jQuery?

Arnab Chakraborty

Arnab Chakraborty

Updated on 23-Jun-2020 11:31:54

3K+ Views

The preventDefault() method stops the default action of a selected element from happening by a user. This method does not accept any parameter and works in two ways:It prevents a link from following the URL so that the browser can't go another page.It prevents a submit button from submitting a ... Read More

Advertisements