1
Vote

Javascript in .xml pane

description

So my "Goal" to to concatenate a Value from

<option value="What I want to be at the begining">ChooseMe</Option>

into the "Computer Name" textbox, after its pulled the asset from the Bios.

So OSDComputerName=%AssetTag% works great, but on the wizard I want a drop down to add a "Site" code before the asset. It works fine in IE/Browsers, but how do I enable Java content in the wizard?



Here is my content.
  1. <script>
  2. // Just an easier way to get an
  3. // element by id in the document.
  4. function $get(id) {
  5. return document.getElementById(id);
  6. }
  7. // This is what's called whenever
  8. // the user types into the input
  9. // box or changes the select value
  10. function config(event) {
  11. var prepend = "foo_",
  12. msgbox = $get("msgbox"),
  13. input = $get("input"),
  14. append = $get("selector");
  15. // Just a shorthand for an "if(){}else{}"
  16. // statement. If input is blank, don't do
  17. // anything but clear the msgbox.
  18. (input.value) ? msgbox.innerHTML = prepend + input.value + append.value :
  19. msgbox.innerHTML = "";
  20. }
  21. // Although this should probably
  22. // be at the top, it's better if
  23. // we declare everything before
  24. // we try to call them. ;)
  25. window.onload = function(event) {
  26. // On load of the window, lets add
  27. // event listeners to our input
  28. // and selector box.
  29. // Input
  30. this.input = $get("input");
  31. this.input.addEventListener('change', config, false);
  32. this.input.addEventListener('keyup', config, false);
  33. // Selector
  34. this.append = $get("selector");
  35. this.append.addEventListener('change', config, false);
  36. }
  37. </script>
  38. <div id="container">
  39. <input id='input' value=""/>
  40. <select id="selector">
  41. <option value="_bar1">_bar1</option>
  42. <option value="_bar2">_bar2</option>
  43. <option value="_bar3">_bar3</option>
  44. </select>
  45. <div id="msgbox"></div>
  46. </div>

comments