Jump to content

johncc

Members
  • Posts

    29
  • Joined

  • Last visited

Posts posted by johncc

  1.  

    Why not just...

    #confirm {}

     

    Man if that works -.- brb

     

    RE: Nah doesn't work. I don't know why. Any reason why it wouldn't :S

     

    It is not like any table that I have used but Dave's suggestion does work.

    <html><head><style>#confirm {  color:red;}</style></head><body><th><form id="confirmation" name="myFormAll" method="post" action="confirm.php">     <input type="number" id="amount" name="amount" style="width:100px;" required min="0" /></th><th>      <input type="submit" value="Confirm" id="confirm" /></form></th></body></html>
  2. Booting - bootstrap loader - refers to the colloquial expression of "dragging something up by it's bootstraps" = using something small to achieve a bigger result. A small segment of code is stored in ROM, performs basic initialization and loads a larger piece of code from external storage to complete the startup process.

  3. Another version. Uses an alert instead of "warning" div and has no submit button. Note that to change the visibility of an element it needs to have an id, so the <p> in your code should have id="warning" not the enclosing div. Is it necessary to allow wrong guesses? If not then a select dropdown would be a better option.

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><script type="text/javascript">var validFiles = ["tree", "chocolate", "bird", "candle", "apple"];function processWord() {  var theWord = inputForm.elements["TypeWord"].value;  if (validFiles.indexOf(theWord) == -1) {    alert("Oops, wrong word, please try again.");  } else {    var newWindow = window.open(theWord + ".php");  }}</script></head><body><div id="main">  <form name="inputForm">    <ul>      <li><input class="inputbox" type="text" name="TypeWord" value="" onchange="processWord()" placeholder="Type a word here"/></li>    </ul>  </form></div></body></html>
    • Like 1
  4. Ok, lets put it this way.. The code i have so far, works flawlessly to read the text line by line from the database. You are telling me to go on a completely different long learning journey to learn something new, which mean, begin learning a whole new way of doing things, which would take me, how long to learn a new language? I find this forum not very friendly, and doubt that I will find any help here. Thank you for not helping.

     

    You seem to have assumed (without doing the suggested research) that JSON is another programming language. It is nothing more that a way of converting data to and from a string representation and is exactly what you need.

  5.  

    how come this does not work then

    <html><body><div id = "TEST" style="width:100%;height:100%;"></div><script>var x = eval("function(){document.getElementById('TEST').style.background = 'red';}");x();</script></body></html>

    The TEST DIV needs some content in innerHTML. In your code it has height 0px

     

    Not sure why, but the eval parameter without the quotes works as expected.

    <!DOCTYPE html><html><body><div id = "TEST" style="width:100%;height:100%;">TEST</div><script>  var x = eval(function(){document.getElementById('TEST').style.background = 'red';});  x();</script></body></html>
  6. Not exactly clear about what you want to achieve, but in your check function instead of setting 'result', can't you just insert the recurring or non-recurring code (or a call to it) as appropriate.

     

    Edit: It occurred to me after answering with the sentence above that you may want another button, the action of which is altered depending on the setting of the checkbox. Is that correct?

  7. I assume there is a typo. My KeyT is indeed a select input with id="keyType">"

     

    document.getElementsByTagName("option") returns an alphabetically sorted (by value) collection of all (6) of the objects of type option on the page. ie C, D, E, F, major, minor. Your values of KeyT and KeyN will index into that collection. Since your KeyT can only have values of 0 or 1, it will always return either C or D not the expected minor or major. Maybe I can make it clearer by including an extra line in my getType.

    function getType() {    var keyT = document.getElementById("keyType");  // the select object    var tIndex = keyT.selectedIndex;                // the index of the selected option    alert(keyT[tIndex].value);                      // the value of the selected option}
  8. To align the headings with the corresponding inputs, include them in the TD's of another table row. And I would agree that there seem to be a few surplus divs in there.

     

    Your index input is constrained to be "number". Make it "text" if you want it as described.

     

     

    EDIT. I see, on further inspection that your Contacts object adds table rows to the end of the table, so if you adopted my suggestion, you would be adding after the data entry row.

×
×
  • Create New...