Win a copy of Python Continuous Integration and Delivery this week in the Python forum!
  • 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
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

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

 
Ranch Hand
Posts: 484
  • 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: 1161
18
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: 484
  • 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: 67241
170
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: 484
  • 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: 67241
170
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: 2406
296
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.
 
Did Steve tell you that? Fuh - Steve. Just look at this tiny ad:
ScroogeXHTML 8.2 - easy to use RTF to HTML converter library
https://coderanch.com/t/707504/ScroogeXHTML-RTF-HTML-XHTML-converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!