{"id":1363,"date":"2005-01-08T10:08:00","date_gmt":"2005-01-08T16:08:00","guid":{"rendered":"http:\/\/www.lordandrei.com\/blog\/?p=1363"},"modified":"2005-01-08T10:08:00","modified_gmt":"2005-01-08T16:08:00","slug":"calling-javascripters-take-my-lj-challenge","status":"publish","type":"post","link":"http:\/\/www.lordandrei.com\/blog\/2005\/01\/08\/calling-javascripters-take-my-lj-challenge\/","title":{"rendered":"Calling JavaScripters, take my LJ Challenge"},"content":{"rendered":"<p>So, many say that LJ is just a repository of fluff. That it holds no real innate value.<\/p>\n<p>So, I now put it out there. This is my test and situation.<\/p>\n<p>I am trying to teach myself JavaScript. I think I&#8217;ve written my code correctly. Only problem is.. it doesn&#8217;t work. Actually it doesn&#8217;t do anything at all<img src=\"http:\/\/www.apolo.cc\/images\/post050108o.gif\"\/><\/p>\n<p>So, below the cut I will explain the problem, code, and issue. I will leave myself logged on via AIM and Yahoo. I am curious to see how long it takes for someone to find read my issue and get in contact with me to aid the solution \ud83d\ude42<\/p>\n<p>Theoretically this is a very simple problem. \ud83d\ude42<\/p>\n<p><!--more Ready? Go!-->This is my current JavaScript quandry it is actually in two parts.<img src=\"http:\/\/www.apolo.cc\/images\/post050108c.gif\"\/><\/p>\n<p>I have created a table that has 3 radio buttons, 3 simple text labels, and 3 text fields and 1 submit button. These all sit  in a form:<\/p>\n<form action=\"\" method=\"post\" name=\"NewData\" id=\"NewData\">\n<table>\n<tr>\n<td><input name=\"ModChoice\" type=\"radio\" value=\"1\"\/><\/td>\n<td>label 1<\/td>\n<td><input type=\"text\" name=\"radio1Text\"\/><\/td>\n<\/tr>\n<tr>\n<td><input name=\"ModChoice\" type=\"radio\" value=\"2\"\/><\/td>\n<td>label 2<\/td>\n<td><input type=\"text\" name=\"radio2Text\"\/><\/td>\n<\/tr>\n<tr>\n<td><input name=\"ModChoice\" type=\"radio\" value=\"3\"\/><\/td>\n<td>label 3<\/td>\n<td><input type=\"text\" name=\"radio3Text\"\/><\/td>\n<\/tr>\n<tr>\n<td colspan=\"3\">\n<div align=\"center\"><input name=\"\" type=\"submit\"\/><\/div>\n<\/td>\n<\/tr>\n<\/table>\n<\/form>\n<p>The form:<br \/>\n&nbsp;&nbsp;&nbsp;Has a name and id of &#8220;NewData&#8221;<\/p>\n<p>The radio buttons<br \/>\n&nbsp;&nbsp;&nbsp;Are all named &#8220;ModChoice&#8221;<br \/>\n&nbsp;&nbsp;&nbsp;Have values of 1, 2, and 3 respectively.<br \/>\n&nbsp;&nbsp;&nbsp;<font face=\"courier\" size=\"-1\">onClick=&#8221;radioClick(this.value)&#8221;<\/font><\/p>\n<p>Up in the <font face=\"courier\" size=\"-1\">&lt;head&gt;<\/font> section of the html I have written the following:<br \/>\n<font face=\"courier\" size=\"-1\"><\/p>\n<pre>\r&lt;script language=\"JavaScript\" type=\"text\/javascript\"&gt;\r&lt;!--\r\rfunction radioClick(radioChoice)\r{\ralert(\"Click in button [\" . radioChoice . \"]\")\rswitch (radioChoice) {\r{{Other stuff removed}}\r}\r}\r\/\/--&gt;\r&lt;\/script&gt;<\/pre>\n<p><\/font><\/p>\n<p>So, question 1. When someone clicks a radio button, why doesn&#8217;t RadioClick get called?. When I hit one of the radio buttons, nothing happens.<\/p>\n<p>Advanced question 2. I&#8217;d like to use the switch statement to change the css &#8220;on the fly&#8221; so that selecting a button causes the text in the unselected choices to change to a dimmer colour and the associated text fields &#8216;disable&#8217;.<\/p>\n<p>From my reading, issue 1 should just work. Granted, I&#8217;ve yet to comprehend how JavaScript feels about semi-colon usage. I&#8217;ve seen examples that do and don&#8217;t use it.<\/p>\n<p>So&#8230; comments? Thanks!<\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-facebook\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-facebook-1363\" class=\"share-facebook sd-button share-icon no-text\" href=\"http:\/\/www.lordandrei.com\/blog\/2005\/01\/08\/calling-javascripters-take-my-lj-challenge\/?share=facebook\" target=\"_blank\" title=\"Click to share on Facebook\" ><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Facebook (Opens in new window)<\/span><\/a><\/li><li class=\"share-twitter\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-twitter-1363\" class=\"share-twitter sd-button share-icon no-text\" href=\"http:\/\/www.lordandrei.com\/blog\/2005\/01\/08\/calling-javascripters-take-my-lj-challenge\/?share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\" ><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Twitter (Opens in new window)<\/span><\/a><\/li><li class=\"share-pinterest\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-pinterest-1363\" class=\"share-pinterest sd-button share-icon no-text\" href=\"http:\/\/www.lordandrei.com\/blog\/2005\/01\/08\/calling-javascripters-take-my-lj-challenge\/?share=pinterest\" target=\"_blank\" title=\"Click to share on Pinterest\" ><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Pinterest (Opens in new window)<\/span><\/a><\/li><li class=\"share-tumblr\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-tumblr sd-button share-icon no-text\" href=\"http:\/\/www.lordandrei.com\/blog\/2005\/01\/08\/calling-javascripters-take-my-lj-challenge\/?share=tumblr\" target=\"_blank\" title=\"Click to share on Tumblr\" ><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Tumblr (Opens in new window)<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>So, many say that LJ is just a repository of fluff. That it holds no real innate value. So, I now put it out there. This is my test and situation. I am trying to teach myself JavaScript. I think I&#8217;ve written my code correctly. Only problem is.. it doesn&#8217;t work. Actually it doesn&#8217;t do [&hellip;]<\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-facebook\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-facebook-1363\" class=\"share-facebook sd-button share-icon no-text\" href=\"http:\/\/www.lordandrei.com\/blog\/2005\/01\/08\/calling-javascripters-take-my-lj-challenge\/?share=facebook\" target=\"_blank\" title=\"Click to share on Facebook\" ><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Facebook (Opens in new window)<\/span><\/a><\/li><li class=\"share-twitter\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-twitter-1363\" class=\"share-twitter sd-button share-icon no-text\" href=\"http:\/\/www.lordandrei.com\/blog\/2005\/01\/08\/calling-javascripters-take-my-lj-challenge\/?share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\" ><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Twitter (Opens in new window)<\/span><\/a><\/li><li class=\"share-pinterest\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-pinterest-1363\" class=\"share-pinterest sd-button share-icon no-text\" href=\"http:\/\/www.lordandrei.com\/blog\/2005\/01\/08\/calling-javascripters-take-my-lj-challenge\/?share=pinterest\" target=\"_blank\" title=\"Click to share on Pinterest\" ><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Pinterest (Opens in new window)<\/span><\/a><\/li><li class=\"share-tumblr\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-tumblr sd-button share-icon no-text\" href=\"http:\/\/www.lordandrei.com\/blog\/2005\/01\/08\/calling-javascripters-take-my-lj-challenge\/?share=tumblr\" target=\"_blank\" title=\"Click to share on Tumblr\" ><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Tumblr (Opens in new window)<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div>","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[1],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1X6ba-lZ","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/www.lordandrei.com\/blog\/wp-json\/wp\/v2\/posts\/1363"}],"collection":[{"href":"http:\/\/www.lordandrei.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.lordandrei.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.lordandrei.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.lordandrei.com\/blog\/wp-json\/wp\/v2\/comments?post=1363"}],"version-history":[{"count":0,"href":"http:\/\/www.lordandrei.com\/blog\/wp-json\/wp\/v2\/posts\/1363\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.lordandrei.com\/blog\/wp-json\/wp\/v2\/media?parent=1363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.lordandrei.com\/blog\/wp-json\/wp\/v2\/categories?post=1363"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.lordandrei.com\/blog\/wp-json\/wp\/v2\/tags?post=1363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}