aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Displaying alert message after submit in textbox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Displaying alert message after submit in textbox" Watch "Displaying alert message after submit in textbox" New topic
Author

Displaying alert message after submit in textbox

rrn rose
Greenhorn

Joined: Apr 14, 2009
Posts: 10
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.....

Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 606

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?


Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
rrn rose
Greenhorn

Joined: Apr 14, 2009
Posts: 10
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......
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

"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.


SCJP, SCWCD.
|Asking Good Questions|
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61417
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 606

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?
Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874

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

Joined: Apr 14, 2009
Posts: 10
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
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61417
    
  67

"rrn rose", please check your private messages for an important administrative matter. Yet again.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Displaying alert message after submit in textbox