This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

js code needed !  RSS feed

 
Arya Devan
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

i need a javascript code snippet to check if the values entered in two subsequent textboxes are the same. if they are the same i need to display an alert ...

and also i m in need of a session invalidate code... as i m new to programming... plz tel me the exact way in wich i hav to include the code in my program..

thanx in advance.
 
Kj Reddy
Ranch Hand
Posts: 1704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Arya Devan:
hi all,

i need a javascript code snippet to check if the values entered in two subsequent textboxes are the same. if they are the same i need to display an alert ...

and also i m in need of a session invalidate code... as i m new to programming... plz tel me the exact way in wich i hav to include the code in my program..

thanx in advance.


Is the text boxes are random text boxes, i mean you do not know the text boxes names. If you know the text boxes names your job is easier.

Code looks like this:

if(formname.textbox1.value == formname.textbox2.value) {
alert("both textbox1 and textbox2 contents are equal);
}
 
Arya Devan
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx reddy,

i do know the names of text boxes... but then... i m using




it gives me and error.. i dunno y....

plz help....

thanks again for the reply...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!