Jump to content


  • Posts

  • Joined

  • Last visited

jwzumwalt's Achievements


Newbie (1/7)



  1. Your code for a slideshow located at - https://www.w3schools.com/howto/howto_js_slideshow.asp will not work as written. It is missing instructions to execute the script. <body onload="showSlides()">
  2. dsonesuk - Thank you for taking the time to explain the problem AND provide the solution. I use to write most my web programs in PHP and have started to convert many of them to JS - would have never figured this out I do keep good notes, and won't have to go through this again!
  3. I am trying to get the value of a radio button. The value of the radio button should get put into the answer box. Why won't the radio value get returned and/or shown? Thx <head> <script> function test() { var myinput = document.getElementById("guess").value; document.getElementById("answer").value = myinput; } </script> </head> <body> <input type="radio" name="guess" value="1"> One<br> <input type="radio" name="guess" value="2"> Two<br> <input type="radio" name="guess" value="3"> Three<br> <input type="radio" name="guess" value="4"> Four<br> <br> <br> Answer <input type="text" id="answer" size=8 style="background-color:#cfc;"> <br> <br> <button onclick="test()">Calculate</button>  </body>
  4. That fixed it! Thanks (I am still baffled why this caused a form submission...)
  5. The link provided did not work so I could not check the source code. A better pattern match is $pattern = "/^(+d{1,2}s)?(?d{3})?[s.-]d{3}[s.-]d{4}$/"; The if statement has two errors. 1) a elseif is needed 2) a condition/check is needed for the elseif There are two else in a row; this is not allowed. it looks like the proper code should be just a single else like this... //Check for a valid phone number if (!empty($_REQUEST['phone'])) { // something was sent $phone = $_REQUEST['phone']; $pattern = "/^[0-9_]{7,20}/"; if (preg_match($pattern,$phone)){ $phone = $_REQUEST['phone']; } else { // illegal chars $errors[] = 'Your Phone number can only be numbers.'; } // end of preg_match } else { // no entry - blank $errors[] = 'You forgot to enter your Phone number.'; } // end of !emptyThis is how the code would be if more than one condition needed to be checked.// proper form of "if...elseif...else"if ( condition ) {// Type your code here} elseif ( condition ) { // other code} else { // other code} //Check for a valid phone number if (!empty($_REQUEST['phone'])) { $phone = $_REQUEST['phone']; $pattern = "/^[0-9_]{7,20}/"; if (preg_match($pattern,$phone)){ $phone = $_REQUEST['phone']; } else { $errors[] = 'Your Phone number can only be numbers.'; } else { $errors[] = 'You forgot to enter your Phone number.'; }
  6. I am not a accomplished js programmer. I am trying to get JS to fill a input box with today's date when a button is clicked. I am using Google Chrome. For some reason the code causes a form submit which I do not want because I would like other form input fields to be able to be filled in. I have done quite a few other js forms and never had this problem. What am I doing wrong? <?phpecho "<HTML> <head> <script type='text/javascript'> function bankdate() { document.getElementById('bankdate').value=Date(); } function invoicedate() { var today = '2015-01-01'; document.getElementById('invoicedate').value=today; } </script> </head> <body> <form name='myform' action='some.php' method='get'> <input type='text' id='bankdate' name='bankdate' class='tcal' size='10' value=''> <button onclick='bankdate(); return false;'>Today</button><br>Bank date</br> <input type='text' id='invoicedate' name='invoicedate' class='tcal' size='10' value=''> <button onclick='invoicedate();return false;'>Today</button><br>Invoice date </br> <br> <button type=submit>save</button> <!-- save button --> <button type=button onclick="javascript:window.location='index.php';">cancel</button> <!-- cancel button --> <button type=button onClick="window.location='" . $_SERVER['PHP_SELF'] . "'">clear</button></td> <!-- clear button --> </form><br><br> </body></html>";?>
  7. Thank you!The CSS example was just what I was looking for.I knew I could do it with Jquery but that really complicates the maintenace of the code.Thanks again!
  8. I have created a database that allows the user to hover over an item and the hint shows the message. I would like the hint to remain on as long as the mouse is over the link. Is this possible?Thanks, jwzumwalt
  9. Thank you for your help. I tried the following and it did not work!<Html><Head><Title>Java Example</Title></Head><Body>The applet is below<br><object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" codetype="application/java" /> <param name="code" value="ohm-1d.class" /> <param name="archive" value="ohm-1d.jar" /></object></Body></Html>
  10. I am a school teacher and am trying to get applets to run for my students. I used the following code and it does not work. I can click on the jar file with a browser and it will work.<Html><Head><Title>Java Example</Title></Head><Body>The applet is below<br><Applet Code="ohm-1d.class"archive="ohm-1d.jar"width=600 Height=600></Applet></Body></Html>The files can be viewed at www.test.neatinfo.com/html
  11. I am a school teacher and administrate a web site for my kids. I have designed a Perl script that makes a custom directory listing. It does not show private or hidden directories. For example it does not show my directories with answers to class home work.My problem is that I have a large site and do not wish to have to custom set a var for each index.html document location so that the Perl script knows what directory to create. Is there an environment variable or some way for my html form to know where it is at (what directory it is in?).Here is an example of what I have to set for each html page... Ugg!<input name="target" value="../html/classes/animation/wk-01-- orientation-safety" type="hidden">Thanks for the help JZ
  • Create New...