Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within HTML Pages with CSS and JavaScript
Search Coderanch
Advance search
Google search
Register / Login
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
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
HTML Pages with CSS and JavaScript
JSP page not showing alert box
Aditi agarwal
Ranch Hand
Posts: 225
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
i have created this page from a website but this still not showing alert box
<html> <head> <script type="text/javascript"> function get_check_value() { var c_value = ""; for (var i=0; i < document.orderform.music.length; i++) { if (document.orderform.music[i].checked) { c_value = c_value + document.orderform.music[i].value + "\n"; } } } </script> </head> <body> <form name="orderform"> What kind/s of music do you listen to?<br> <input type="checkbox" name="music" value="Rock" checked="checked"> Rock<br> <input type="checkbox" name="music" value="Reggae"> Reggae<br> <input type="checkbox" name="music" value="Pop"> Pop<br> <input type="checkbox" name="music" value="Rap"> Rap<br> <input type="checkbox" name="music" value="Metal"> Metal<br> <input type="submit" onclick="get_check_value()"> </form> </body> </html>
thanks in advance
Swastik Dey
Bartender
Posts: 2270
20
I like...
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Where are you showing the alert??
Swastik
Aditi agarwal
Ranch Hand
Posts: 225
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
its alert box as soon as we click on the submit button it will show an alert box
check this
http://www.sislands.com/coin70/week4/chkBoxTest.htm
Swastik Dey
Bartender
Posts: 2270
20
I like...
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Where are you calling the alert method in your code?
Swastik
Aditi agarwal
Ranch Hand
Posts: 225
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
sorry but i couldnot get you
can you tell me what exactly you want to ask
please
thanku
Swastik Dey
Bartender
Posts: 2270
20
I like...
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
To show an alert you need to call the window.alert method.
function get_check_value() { var c_value = ""; for (var i=0; i < document.orderform.music.length; i++) { if (document.orderform.music[i].checked) { c_value = c_value + document.orderform.music[i].value + "\n"; } } window.alert(c_value); }
Swastik
Aditi agarwal
Ranch Hand
Posts: 225
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
k thanks it means i was just calling alert functin but not mentioning where
thank you but i also dont know about this function thanks for telling me
Bear Bibeault
Sheriff
Posts: 67746
173
I like...
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Please take the time to choose an appropriate forum for your posts. This forum is for questions on
JSP
. For more information, please click this link ⇒
CarefullyChooseOneForum
.
This post has been moved to a more appropriate forum.
[
Asking smart questions
] [
About Bear
] [
Books by Bear
]
Eric Pascarello
author
Posts: 15385
6
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
looks fine to me:
http://jsbin.com/acube4/edit
Eric
That's my roommate. He's kinda weird, but he always pays his half of the rent. And he gave me this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
jQuery: how to determine if any checkbox is checked.
Selecting all the checkbox by hiting the submit button in jsp
javaScipt onsubmit problem in jsp
geting focus on radio button
Check file size with Javascript before uploading
More...