Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning 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
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

Displaying alert message after submit in textbox

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi..

in my website , i have a form for sending emails...
everything is working fine, except one..

in the form there is two fields, one for entering name and other for email id..

my problem is tat , even after filling both the text fields and then click ' submit', it is showing alert to enter name and email...

please help me to solve it..

below shown is the code i have used..



please help me to solve this.....

 
Ranch Hand
Posts: 607
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't undertand what

ss[i].checked in function checkname(ss) is supposed to do?
ss.checked in function checkemail(ss) is supposed to do?
 
rrn rose
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you please help me to find a code for validation of fields in text box???

ie i have a form in which there is two textfields for entering name and email.. when i click ' submit' it is gone to my email..

when anyone clicks 'submit' whenever a field is blank , it should display an alert message..

hope you understood .......

Thanks......
 
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"rrn rrn " welcome to Javaranch
please check your private messages for an important administrative matter. You can check them by clicking the My Private Messages link above.
 
Sheriff
Posts: 67389
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Establish a submit handler on the form in which you can validate the fields. Return false in order to prevent the form from submitting is you find problems.
 
Saifuddin Merchant
Ranch Hand
Posts: 607
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Establish a submit handler on the form in which you can validate the fields. Return false in order to prevent the form from submitting is you find problems.



There is already a submit handler in the code - onsubmit="return validate();" which does return false (agree its in bad shape) when the validation fails. Or does a submit handler mean something else?
 
Ranch Hand
Posts: 874
Android VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Sam Mercs wrote:I don't undertand what

ss[i].checked in function checkname(ss) is supposed to do?
ss.checked in function checkemail(ss) is supposed to do?



Yes certainly they are not related to textbox property.

rrn,
simple check would do
 
rrn rose
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you to all who helped me to solve this..
now its working...

really appreciate all of your willingness to help me...

thank you...
 
Bear Bibeault
Sheriff
Posts: 67389
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"rrn rose", please check your private messages for an important administrative matter. Yet again.
 
Not looking good. I think this might be the end. Wait! Is that a tiny ad?
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic