Jump to content

ameliabob

Members
  • Posts

    218
  • Joined

  • Last visited

Everything posted by ameliabob

  1. OK I tried to simplify the code but still can't get it to work. $s .= "<td"; $s .= " onclick=\"GetFinishedData('9')\" > "; $s .= $r[symbol]."</td>"; When I look at the generated code it looks like it should. Maybe I have run out of little grey cells.
  2. Would you mind modifying whichever string to fix this? Thanks
  3. I am building a table at a server and returning it to the user I have tried putting the $p where it is as shown. I have also tried it in the first <td $s =" <td ".$p.">><input type='radio' name='entry' ></td>"; It does not seem to get to GetFinishData(). Any thoughts or how can I get whatever failure to show up somewhere? $p = "onclick=\"GetFinishData('".$r[rowId]."')\""; $s =" <td>><input type='radio' name='entry' .$p.></td>"; Thanks
  4. I am having trouble finding where the attributes for getElementById are located <input id='opt' type='radio' name='kind' value='O'>Options <input id='stk' type='radio' name='kind' value='S'>Stocks How in js do I determine which one of these was chosen? getElementById('stk').value doesn't seem to work when going after the one not chosen. I seem to think there might be "selected" attribute but I can't find it documented anywhere. Thanks
  5. Maybe a better way to put the question is to see what the server side looks like that interprets the input from a Submit function
  6. In the html examples action_page.php is often referred to but there is no example of what the code itself looks like. I would like to see what that code is/does.
  7. Is there a way that I can view the action_page.php so I can see what the server side looks like for a submit button? Also How do I differentiate between multiple submit buttons?
  8. I am just getting restarted and am having problems finding syntax problems <code> <!DOCTYPE html > <html > <head> <style> body {margin:0;font-family:"Trebuchet MS", "Arial Black", "Verdana", "Helvetica", sans-serif;} #seltype {font:36px} #header {background:blue; color:white; position:absolute; top:0;left:0px;right:0;margin:0;text-align:center;font-family:"Trebuchet MS", "Arial Black", "Verdana", "Helvetica", sans-serif;font-weight:bold; white-space: nowrap;} #header h1, #header p {padding:2px 20px 2px 100px;margin:0} #hdgline {text-align:center; font-size:1.875em;} button {font:24px "Trebuchet MS", "Verdana", sans-serif;background:#F9CC7D;border:outset #F9CC7D} </style> <title>Year to Date P/L</title> </head> <body> <div id="header"> <p><br /></p> <h1 id="hdgline" style="font-size:36px">Year to Date P/L</h1> <p><br /></p> <button onclick='AddTrade()' >Enter Trade</button> <button onclick='ExitTrade()' >Exit Trade</button> <button onclick='ShowPL()' >Show P/L</button> </div> <div id="cond"> <p> <input type="text" name="first" value="me"></br> </p> </div> </body> </html> </code> The input line does not display. The buttons do. What am I missing?? Thanks
  9. I am trying to create a class which will concatenate variables but it appears as though each time a function within a class is called the variables are reinitiated. Is there a way that the variables can be held so as to allow them to be added to? The first code box is the calling functions and the second is the class. <?php include ("myClasses.php"); $sTable = new TABLE(); $sTable->setHeading("This is the heading"); $sTable->setHeadingItem("Symbol"); $sTable->setHeadingItem("Name"); $sTable->setDetailItem("F"); $sTable->setDetailItem("Ford"); $sTable->endTable(); echo($sTable->showTable()); ?> myClasses.php <?php class TABLE { private $border; private $hdrStarted = false; private $rowStarted = false; private $numberOfRows=0; private $s; function __construct($border=null){ $s = "<table "; if(is_null($border)) $s .= ">"; else $s .= "border='".$border."'>"; } function setHeading($t){ $s .= "<caption>".$t."</caption>"; echo $s; } function setHeadingItem($t){ if(!$hdrStarted){ $s .= "<tr>"; $hdrStarted = true; } $s .= "<th>".$t."</th>"; } function setDetailItem($t){ if($hdrStarted){ $s .= "</tr>"; $hdrStarted = false; } if(!$rowStarted){ $rowStarted = true; $s .= "<tr>"; } $s .= "<td>".$t."</td>"; } function endTable(){ if($rowStarted || $hdrStarted) $s .= "</tr>"; $s .="</table>"; } function showTable(){ return $s; } } ?>
  10. It's not AJAX as I have been using that all along.
  11. I tried to use the first method and I go the message "Permission denied to access property "SendOffRequest". The first code window is the main calling program. The user pushes [ctrl][t] and the second code window is loaded. when one of the buttons is clicked the error message occurs. The highlighted in Bold which calls the BOLD Italics and then the error. [codewindow] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <script type="text/javascript"> var CtrlPushed=false; function CheckKey(e){ var keynum; if(window.event) // IE keynum = e.keyCode; else if(e.which) // Netscape/Firefox/Opera keynum = e.which; if(keynum==17) { // Chceck for Ctrl pushed CtrlPushed = true; // 17 is ctrl } if( CtrlPushed ){ // Only look at these if user has initiated the CTRL sequence switch (keynum){ case 80: // Test for P or case 84: // test for T ptWindow= window.open("http://test.comsum.atflorida.us","ptWindow"); break; } } } function SendOffRequest( whatIsIt){ //alert(whatIsIt); if (window.XMLHttpRequest) { myRequest = new XMLHttpRequest(); } else if (window.ActiveXObject) { myRequest = new ActiveXObject("Microsoft.XMLHTTP"); } if(myRequest){ var url = "comsumProcess.php?function=" + whatIsIt + "&uDate=" +uDate+"&device="+device+ "&userID=" + userID+"&uProfile="+uProfile; lastSentRequest = url; // Save this for any error message url += "&sid=" + Math.random(); myRequest.open("GET", url, true); } // STUFF DELETED HERE AS IT DOESNT'T APPLY </script> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" type="text/css" href="computer.css" /> <title>Commodity Summary</title> </head> <body onkeydown="CheckKey(event)"> <div id="header"> <p><br /></p> <h1 id="hdgline" style="font-size:36px">Trend Tracker SQL version </h1> <p><br /></p> <div id="hdgbtns" align='center'> </div> </div> <div class="content" id="content"> </div> </body> </html> [/codewindow] SECOND CODEWINDOW [codewindow] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <script type="text/javascript"> var s; var userID="prdtst"; var uProfile="WhatIf"; var uDate="2009-09-07"; var uLastAction; var device="computer"; var OFFSET=5; /* function SendOffRequest( whatIsIt){ document.getElementById("function").value=whatIsIt; document.getElementById("submitForm").submit(); } */ function CaseSetup(){ window.opener.SendOffRequest("casesetup"); } function EndSetup(){ window.opener.SendOffRequest("casefinish"); } function DeleteTC(s){ var a = s.split(","); var t = "Confirm that you want to delete Test Case number "+a[1]+" "+" named "+a[2]+"<br>"+a[3]; if (confirm(t)==true) window.opener.SendOffRequest("deleteTC&tcnumber="+a[0]); } function ListCases(){ window.opener.SendOffRequest("listcases"); } function ShowHomeScreen(){ var s = "<button id= 'Button' onclick='CaseSetup()' >Define Testcase</button>"; s += "<button id= 'mainButton' onclick='RunCases()' >Run Testcase(s)</button>"; s += "<button id= 'mainButton' onclick='ListCases()' >List Testcases</button>"; document.getElementById("hdgbtns").innerHTML = s; } function ShowDetails(num){ document.getElementById("num").value = num; SendOffRequest("showdetails"); } function StartSetup(){ var tnumber = ptWindow.document.getElementById("testno").value; var tname = ptWindow.document.getElementById("testname").value; var tdesc = ptWindow.document.getElementById("testdesc").value; var x = ptWindow.document.getElementById("userPtr").selectedIndex; var y = ptWindow.document.getElementById("userPtr").options; // alert("Index: " + y[x].index + " is " + y[x].text); SendOffRequest("startsetup&number="+tnumber+"&name="+tname+"&desc="+tdesc+"&acct="+y[x].text); } </script> <head> <link rel="stylesheet" type="text/css" href="comsumtest.css" /> <title>Test Library</title> </head> <body onload="ShowHomeScreen()"> <div id="header"> <p><br /></p> <h1 id="hdgline" style="font-size:36px">Comsum Test Library </h1> <p><br /></p> <div id="hdgbtns" align='center'> </div> </div> <form id="submitForm" action="testFunctions.php" method="get"> <input id = "function" type="text" name="function" hidden>; <input id = "num" type="text" name="numb" hidden> <div class="content" id="content"> </div> </form> </body> </html> [\codewindow] Now what have I done wrong.
  12. I am trying to write something with two windows but with common code used by both. I have put together a simple example bu the alert never occurs <!DOCTYPE html> <html> <body> <p>Click the button to open a new window called "MsgWindow" with some text.</p> <button onclick="myFunction()">Try it</button> <script> function myFunction() { var myWindow = window.open("", "MsgWindow", "width=200, height=100"); myWindow.document.write("<p>This is 'MsgWindow'. I am 200px wide and 100px tall!</p>"); myWindow.document.write("<button onclick='BackHere()'>Return</button>"); } function BackHere(){ alert("I made it!"); } </script> </body> </html> What linkage am I missing? Thanx
  13. ameliabob

    Inner Joins

    OK, thanks. I interpreted the example as having single quotes not back ticks.
  14. ameliabob

    Inner Joins

    I have tried using tables with and without quotes and field names with and without quotes and I keep getting the error: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.* , 'commmoditybase'.'cf' FROM 'dailydata' INNER JOIN 'commoditybase' on 'daily' at line 1 SELECT 'dailydata'.* , 'commmoditybase'.'cf' FROM 'dailydata' INNER JOIN 'commoditybase' on 'dailydata'.'symbol'='commoditybase'.'symbol' WHERE contractDate='2012-06-13' ORDER BY contract Do I have the WHERE and ORDER BY in the wrong sequence? Thanx
  15. OK I fixed the getEle... to document.getElement... But I still can't figure out how to get the new string to concatinage after the href=
  16. I am trying to modify an href object and cannot find the correct syntax I took the code from a W3Schools to use a an example <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD><TITLE>Untitled</TITLE> <META content="text/html; charset=windows-1252" http-equiv=Content-Type> <META name=GENERATOR content="MSHTML 11.00.10586.35"></HEAD> <BODY> <script language="JavaScript" type="text/javascript"> function SendURL(){ s="http://www.w3schools.com"; getElementById('url').value = s; } </script> <a id='url' href= >Visit W3Schools</a> <button type='button' onclick='SendURL()'/>Send Off Request</button> </BODY></HTML> The line that I am having trouble with is the one "getElementById('url').value = s;" and the line beginning with "<a" Or is the href not allowed to be altered? Thanks
  17. I am setting up a testing database where the preconditions of the data are stored and some step is performed and then the results are compared to what they should have become. In the previous example it might have been easier to have: $fieldValues = "'true,43,right"; and after the same area would have $answer ="false,43,left" so I would preload a file execute a program and then see if $fieldValues had changed to $answer
  18. I am trying to insert a string in a single field but cannot figure out what the syntax should be $s ="abc"; $s .=",def"; $qry = "INSERT INTO ".table." (baseID,tableName,fieldNames) VALUES ('8','headerfields' , '' ".$s." ' )"; This gives me the: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near... How do I encapsulate the $s string to not have this count as additional fields? Thanx
  19. I am trying to write a function that determines the users browser and then calls the appropriate program./function, I am using this is "startup.php" [codebox}<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /><?php $useragent = $_SERVER['HTTP_USER_AGENT']; $a = explode("(",$useragent); $d = explode(";",$a[1]); switch (substr($d[0],0,6)){ case "iPhone": header("Location: http://testcomsum.atflorida.us/phone.startup.php"); break; case "Window": header("Location:http://testcomsum.atflorida.us/c.startup.php"); break; case "Androi": header("Location: http://testcomsum.atflorida.us/phone.startup.php"); break; default: echo("The device called is ".$d[0]." and needs to be added."); }?> [/codebox] I get the message that the startup.php cannot be found.
  20. I am having trouble with the fact that I am doing the browser to server always with the same file. I do not need the flexibility to change the file names. How would I code the "copy" functioin?
  21. ameliabob

    Uploading a file

    I am trying to upload a simple text file from the browser to the server. I have used the example in the w3schools but I still get the "Sorry, there was an error uploading your file." message. How do I find out what the error is? The code is as follows: <codebox><?php$target_dir = "E:/wamp/www/profitsrun/";$target_file = "alert.txt";$uploadOk = 1;$upload_dir = "c:/profitsrun/";$upload_file = $upload_dir.$target_file;echo($target_file."<br>");echo("file_to_upload is ".$upload_file)."<br>";echo("it will be put in ".$target_dir.$target_file."<br>");// Check if file already existsif (file_exists($target_dir.$target_file)) { echo($target_dir.$target_file); echo "Sorry, file already exists."; $uploadOk = 0;}// Check if $uploadOk is set to 0 by an errorif ($uploadOk == 0) { echo "Sorry, your file was not uploaded."; // if everything is ok, try to upload file} else { if (move_uploaded_file($upload_file, $target_dir.$target_file)) { echo "The file ". $upload_file. " has been uploaded."; } else { echo "Sorry, there was an error uploading your file."; }}?></codebox>
  22. I am trying to create a title line with two different font sizes Attached is a part of the CSS file and the Javascript that it uses <div id="hdg"> <div id='title1'>AMELIA ISLAND</div> <div id='title2'>MUSEUM</div><div id='title3'> of</div><div id='title2'> HISTORY</div> </div> and the CSS is div#hdg{background-color:maroon; font-size:36px; color:#f2eadf; padding:10px; border:0;font-weight:bold;} div#title1{position:relative; left:15em; font-size:1em;font-weight: bold;display: block;} div#title2{position:relative; left:7.5em; font-size:2em;font-weight: bolder;} div#title3{ font-size:1em;font-weight: bold;} [/codebox] This puts an extra lines between the 'of' and the line before and after it. How do I get this to be on a single line? Thanks
  23. Basically because I never learned how. BTW your answer was the problem. I had used the same id elsewhere in the code. thanks
  24. s is a global defined outside of the function. I don't see how trimming the 'id' s will do anything to help. The firebug does not day that it cannot find the id'd item. Its just that it returns nothing. I have looked inside the table definitions to see if the id should be there instead of the input item but that doesn't seem to work either.
  25. I have been looking at this for some time and cannot figure out what is different. I have the following code <script type="text/javascript"> function AddBook(){ s = "<table>"; s += "<tr><td>Purchase Date</td><td><input type='text' id ='pdate' width='10'/></td></tr>"; s += "<tr><td>Title</td> <td><input type='text' id ='title' width='75' value='MyBook'/></td></tr>"; s += "<tr><td>Author</td> <td><input type='text' id ='author' width='50'/></td></tr>"; s += "</table>"; s += "<p id='buttons'><button onclick='AddBookFinal()'>Add Book to File</buttton></p>"; document.getElementById("response").innerHTML = s; } function AddBookFinal(){ var title = document.getElementById('title').value; var author = document.getElementById('author').value; var purDate = document.getElementById('pdate').value;alert("addbook&author="+author+"&purDate="+purDate+"&title="+title); // SendOffRequest("addbook&author="+author+"&purDate="+purDate+"&title="+title); }</script> The alert is just for debuggin purposes. The alert does not show anything for the title. There are no errors showing in Firebug and the 3 getElementsById don't seem to function. What am I not seeing? Thanks
×
×
  • Create New...