• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Is it possible to use Bootstrap to validate form without using JavaScript?  RSS feed

 
Ranch Hand
Posts: 468
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I used to use javascripts/jquery/regex to validate form.  But, that was back in 2010.

I wonder how things have changed now and what are the latest trends in doing things?

Currently, I am using Bootstrap, I wonder if Javascript is still necessary or can we just  use Bootstrap alone to validate form and make sure the fields are not empty?

What are the techniques we can use, should the user disabled javascripts in their broswer?

My app is using Java 8 with Java EE and tomcat.

Tks.

 
Master Rancher
Posts: 920
17
Firefox Browser Hibernate IntelliJ IDE Java MySQL Database Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if the only thing you need to do is make sure that the inputfields aren't empty, you can add required to your input tags.
Otherwise there's always jsp or jsf
 
tangara goh
Ranch Hand
Posts: 468
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Daniel Demesmaecker wrote:if the only thing you need to do is make sure that the inputfields aren't empty, you can add required to your input tags.
Otherwise there's always jsp or jsf



<code>
<div class="control-group form-group">
<div class="controls">
<label>Address 1:</label> <input type="text" class="form-control" <br /> id="address1" name="address1" required <br /> data-validation-required-message="Please enter your blk no.">
</div>
</div>
</code>

So, like the above it should be ok?

However, I noticed that whenever I leave blank, the message Please enter your blk no is not appearing.

Have I missed something?
 
Marshal
Posts: 67197
169
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cannot put HTML element in the middle of other HTML elements.
 
tangara goh
Ranch Hand
Posts: 468
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bear Bibeault wrote:You cannot put HTML element in the middle of other HTML elements.



I am sorry but I do not get what you mean.

 
Bear Bibeault
Marshal
Posts: 67197
169
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

tangara goh wrote:

Bear Bibeault wrote:You cannot put HTML element in the middle of other HTML elements.


I am sorry but I do not get what you mean.


Perhaps it's just that the code in your post is badly formatted. Please post your code again, and be sure to UseCodeTags to make sure that the formatting of the code is correct.
 
Saloon Keeper
Posts: 2268
290
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rather than formatting your HTML using an HTML <code> tag, use the JForum editor's Code button (select JavaScript for best syntax highlighting).  What you posted before shows some embedded <br /> tags inside the <input> tag.
 
A lot of people cry when they cut onions. The trick is not to form an emotional bond. This tiny ad told me:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!