KnowledgeBase/Languages/JavaScript - Cheatsheet for Learning JavaScript

source: above
document.getElementById("myCheckBox").checked;
One reads radio buttons in javascript in a strange way.  The easiest way seems to be to give each radio a id="whatever" and then access with code like:

tag <input  type="radio"  name="choice" id="choiceTag"  value="tag" />
title <input type="radio"  name="choice"  id="choiceTitle" value="title"  />

<script type="text/javascript">
    var choice = "tag";
    if (document.getElementById("choiceTitle").checked) {
        choice = "title";
    }
</script>

Which sets choice to be either "tag" or "title" depending on which was selected.  Then choice can be communicated Ajax style back to the server like this:

liveSearchReq.open("GET", liveSearchRoot + "/tagSearch.php?q=" + document.forms.searchform.q.value + "&choice=" + choice +  liveSearchParams);

The PHP at the server reads the variable from $choice

This is running on tagSearch.html but the choice does nothing yet on the server side.


Tags

  1. javascript
  2. radio buttons
  3. live search

See Also

  1. Thought dynamic cartoons with 5 viewings related by tag "javascript".
  2. Thought JavaScript based HTML editor with 5 viewings related by tag "javascript".
  3. Thought tag display and navigation project with 3 viewings related by tag "live search".
  4. Thought automatic bookmarks and intentional bookmarks with 3 viewings related by tag "live search".
  5. Thought open source javascript spreadsheet engine with 3 viewings related by tag "javascript".
  6. Thought Advanced Live Search with 1 viewings related by tag "live search".
  7. Thought about: TrimSpreadsheet - TrimPath - Trac with 1 viewings related by tag "javascript".
  8. Thought DHTML is a marketing term with 0 viewings related by tag "javascript".
  9. Thought Replacing live search with 0 viewings related by tag "live search".
  10. Thought add groups to the live search with 0 viewings related by tag "live search".
  11. Thought kewl javascript mp3 player with 0 viewings related by tag "javascript".
  12. Thought round corners without images with 0 viewings related by tag "javascript".
  13. Thought javascript zoom with 0 viewings related by tag "javascript".
  14. Thought The time has come to JavaScript ... or not ... with 0 viewings related by tag "javascript".
  15. Thought about: Dragable RSS boxes with 0 viewings related by tag "javascript".
  16. Thought about: How to Develop Web Applications with Ajax, Pt. 1 - WebReference.com - with 0 viewings related by tag "javascript".
  17. Thought about: PEAR :: Package :: HTML_AJAX with 0 viewings related by tag "javascript".
  18. Thought about: rich text editing with dojo with 0 viewings related by tag "javascript".
  19. Thought web spreadsheets with 0 viewings related by tag "javascript".
  20. Thought Preview of Ajax tag search at fastblogit with 0 viewings related by tag "live search".
  21. Thought programming of edit tag with 0 viewings related by tag "javascript".
  22. Thought QA understands the code ! with 0 viewings related by tag "javascript".
  23. Thought The Live Search and tag list panel with 0 viewings related by tag "live search".
  24. Thought Announcement: live search in tag or title with 0 viewings related by tag "live search".