Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by mickeymouse

  1. Sorry. I guess I wasn't clear. I am using "onsubmit" in Form. My input tag is a "type=submit". When the user clicks on this 'submit' button more than once (or presses the "Return" key more than once) I end up with multiple entries. My "onsubmit" goes to a function that checks to see if the input number is valid and if OK the submission is allowed (return true). So, how do I prevent multiple submissions from taking place. There should not be another entry until there is a visible server response to the first submission.
  2. My page allows the user to type in a number and click Enter or press the Enter Key (submit button). My next page then process that number. But if the user clicks twice (or presses the Enter Key twice), my next page gets the number twice. How can I prevent the user from doing this double entry? e.g. Can I disable the submit button after it's been used? Tks
  3. I believe my code matches the W3Shool documentation. It works well in W3S example but it doesn't work in my page. I get a blank result. function myentry() {var mycode='B'; var myres = mycode.fontcolor('red'); document.getElementryById('lastentry').innerHTML = myres; return true;} if I use: document.EntryForm.lastentry.value = result; return true;} I get: <font color="red">B</font> Any idea why? Tks
  4. I just found out - it looks like my web service provider is the one that cut off my e-mail service. I will confirm to you later.
  5. Thanks but "\r\n" didn't change the situation.
  6. I want to send an e-mail. Is this not correct code? The first time I tested it, the e-mail went through. Now it just doesn't go. Do I need to have an e-mail account with my web service provider in order to have my code send an e-mail? $to = $MyEMailaddr; $subject = 'My Website'; $message = $mymsg; $headers = 'UserID & Password' . '\r\n'; mail($to,$subject,$message,$headers); I'm sure $MyEMailaddr contains the correct e-mail address (I have the proof). Same with $Mymsg.
  7. I don't quite understand all this but I will work on it. However, I've defined a button with style='width:100' and it stays the same width no matter what value I assign and if my value is greater than the width, the extra just doesn't show - that's why I was trying to get word wrap.
  8. I don't see how the Display Property is going to help me. I'm just trying to format my BUTTON to word wrap (as can be done in Excell for instance) so that I don't need to have a button that is excessively wide.
  9. How can I get word wrap for button text? I've tried several ways (one below) but nothing works. <style type=\"text/css\"> w.{word-wrap:break-word;} </style> <input type='submit' style='background-color:red;width:430;height:150;font-size:40;font-weight:bold' class='w' value='RAYER les DERNIER (de 1 à 99)>
  10. Thanks. But what is the problem now?I keep getting the alert message no matter if my slice is a,l or any thing else. function mychk(myfld) {with (myfld) {if(bud.checked==true) {var str = myfld.value; if(str.slice(-1) == 'a' || str.slice(-1) == 'l'); {alert('TRANSACTIONS ARE NOT POSSIBLE FOR a OR l ACCOUNTS.');} <------- I keep getting the message no matter what. } }}
  11. Trying to get the last character of a string but get absolutely nothing - no result, not even an alert execution. What's wrong with my substr? It seems to me it agrees with the W3S documentation. function mychk(myfld) {with (myfld) {if(bud.checked==true) {var x = myfld.value; alert(x); <--------------------------- Shows correct results var r = substr(myfld.value,-0,1); <---------Trying to get thelast character of the string. alert(r); <------------------------------ No alert at all } }} NOT ANYBETTER IF I USE var r = substr(x,-0,1); alert(r); <-------------Still no alert.
  12. I thought I was passing 3 integers via $mydt because it contains "1,1,2020" I've made the change to pass 3 integers ($mymm,$mydd,$myyr) and it works fine. Many thanks, Mickey
  13. $mydt=$mymm.','.$mydd.','.$myyr; print("$mydt<br>"); ------------------>= 1,1,2020 $myjd=gregoriantojd($mydt); print("$myjd<br>"); ------------------>= blank (why???) $myname=jdmonthname($myjd,0); print("$myname<br>"); ---------------->= blank (why???) W3 Documentation: $jd=gregoriantojd(1,13,1998); echo jdmonthname($jd,0); ------------>= Jan It seems to me my code agrees with the documentation but it doesn't work.
  14. Thanks for clarifying. I thought it was available according to what I thought I had seen in documentation. It's unfortunate that this is not possible.
  15. With this, I get no borders (as requested): <input readonly style='border:none;color:black;text-align:left;width:100;font-size:16' value='$ActNm'> With this, I get borders all around while I just want a bottom border. <input readonly style='border:bottom;color:black;text-align:left;width:100;font-size:16' value='$ActNm'>
  16. Thanks but this wont do the job. I dont think using <div> and </div> tags for every <input...> tag I have is the way to do it. What I'm looking for is bottom borders for my <input...> tag. Also, the W3 example of margins doesn't even work in the W3 documentation itself. Go there and try to modify the margin sizes!
  17. How do I get bottom borders or left borders only? In my input tag, I've used style='border:none' --- works fine. style='border:left' --- I get all borders. style='border:bottom' --- I get all borders. TKS
  18. Yes, I know they can be tough. That's why I went to the forum.
  19. the dump, mor precisely, the print is AcctNameA Array[1] Array[2] Array[3] ... Array[12] AcctNameB Array[1] Array[2] Array[3] ... Array[12] etc for each account name entry. Obviously my $amts[$cntr][1 to 12] doesn't work. But what should it be?
  20. Re #1: Actually, $acnm is not a numeric array. It's an array that contains the account names. $cntr is numeric. So I don't see a problem with $acnm[$cntr] and it does work. Re #2: I agree the print does not need the curly brackets, but I would think that they don't cause a problem. Anyway, thanks for spotting it and I'm removing them. Re #3: I expect that I have one of these "$amts[$cntr]=Array(0,0,0,0,0,0,0,0,0,0,0,0,0);" for each account as created by my earlier code: $cntr=0; while($cntr<$numacts) {$cntr=$cntr+1; $amts[$cntr]=Array(0,0,0,0,0,0,0,0,0,0,0,0,0); } Then with $amts[$cntr][1] to $amts[$cntr][12] I am trying to extract the 12 months in each account's array.
  21. Please tell me where all the errors and warnings are. All of it seems to work except for the last part which is the printing. // PRINT ACCOUNT FROM ACCOUNTS TABLE & // MONTHLY AMOUNTS FROM AMOUNTS TABLES // THIS IS THE PROBLEM - IT DOESN'T WORK! <------------- $cntr=0; while($cntr<$numacts) {$cntr=$cntr+1; {print("$acnm[$cntr] $amts[$cntr][1] $amts[$cntr][2] $amts[$cntr][3] $amts[$cntr][4] $amts[$cntr][5] $amts[$cntr][6] $amts[$cntr][7] $amts[$cntr][8] $amts[$cntr][9] $amts[$cntr][10] $amts[$cntr][11] $amts[$cntr][12] <br>"); } } // PRINTING RESULTS: accountA Array[1] Array[2] Array[3] ... accountB Array[1] Array[2] Array[3] ... etc for each account name entry.
  22. I don't know if an SQL query would help. For the moment, can you look at my code and see if you can identify errors. I've used this code approach in another report and it works but here, I can't make it work. Tks $acnm=array(); $acmo=0; $numacts = $AffectedRows; // LOAD ACCOUNT NAMES FROM ACCOUNTS DB TABLE // INTO ACCOUNT NAME TABLE // WORKS OK - PROVEN BY A TEST PRINT. // $row[2] is the account name index. // $row[1] is the account name. while ($row = mysql_fetch_row($Results)) {$acnm[$row[2]]=$row[1]; } //------------------------------------------- // CREATE & INITIALIZE AMOUNTS TABLES // COVERING 12 MONTHS FOR EACH ACCOUNT NAME $cntr=0; while($cntr<$numacts) {$cntr=$cntr+1; $amts[$cntr]=Array(0,0,0,0,0,0,0,0,0,0,0,0,0); } //------------------------------------------- // LOAD AMOUNTS FROM TRANSACTIONS INTO TABLES // $row[4] and $row[5] are account indexes // $row[3] is the ammount $cntr=0; while ($row = mysql_fetch_row($Results)) {$cntr=$cntr+1; $effmo = substr($row[1],5,2); //extract month from date field. $amts[$row[4]][$effmo]=$amts[$row[4]][$effmo] - $row[3]; //* $amts[$row[5]][$effmo]=$amts[$row[5]][$effmo] + $row[3]; //* } // * Should be OK as I've used this in other reports and it worked. //------------------------------------------- // PRINT ACCOUNT FROM ACCOUNTS TABLE & // MONTHLY AMOUNTS FROM AMOUNTS TABLES // THIS IS THE PROBLEM - IT DOESN'T WORK! $cntr=0; while($cntr<$numacts) {$cntr=$cntr+1; {print("$acnm[$cntr] &#160;$amts[$cntr][1] &#160;$amts[$cntr][2] &#160;$amts[$cntr][3] &#160;$amts[$cntr][4] &#160;$amts[$cntr][5] &#160;$amts[$cntr][6] &#160;$amts[$cntr][7] &#160;$amts[$cntr][8] &#160;$amts[$cntr][9] &#160;$amts[$cntr][10] &#160;$amts[$cntr][11] &#160;$amts[$cntr][12] <br>"); } } // PRINTING RESULTS: accountA Array[1] Array[2] Array[3] ... accountB Array[1] Array[2] Array[3] ... etc for each account name entry.
  23. I don't see how I can use this. I can't define $acct_a = 'company abc'; $acct_b = 'company stu'; $acct_c = 'company xyz' etc for 100 or 200 unknown accounts; nor can I define $val_1 = 35; $val_2 = 1007; $val_3 = 20004567543; maybe 1,200 unknown amounts. What I need is to define a table where I can dump & accumulate data into it from user data which comes from my database and then retrieve the results from the table and print/display it in a report form.
  24. Niche, I've looked at /studied all the W3S documentation and it doesn't solve my problem. The same with your example (maybe it's a case that I don't understand). I don't have fixed data to put in the table - like Peter and age etc. My equivalent of Peter, Ben and Joe would be account names and I don't know what they are -they are the user's entries and different for different users. So, what I need is to define the table, then have code to fill the table with the user's input, and then code to extract from the table to print. If you look at my posting again you will have a better idea of what I mean - I have done an edit giving more info. (My original posting was incomplete and got posted by accident). I hope you can help me - I've been working on this all day - wasted time unfortunately. Thanks
  25. I need to set up the following table (or ARRAY) but don't know how to define it. Acct A month 1 month 2 month 3 …. month 12 Acct B and so on (unknown quantity ) I tried various solutions but no success. My latest code is: //Deffinition: $AcctNum=array ( $MyMonths=array() ); Filling: $MyMonths[$row[5]][$effmo] = $MyMonths[$row[5]][$effmo] - $row[3]; Extracting: print("$AcctNum[1] $MyMonths[1] $MyMonths[2] ....... $MyMonths[12]<br> $AcctNum[2] $MyMonths[1] $MyMonths[2] ....... $MyMonths[12]<br> etc. ");
  • Create New...