Jump to content

njdubois

Members
  • Posts

    200
  • Joined

  • Last visited

Everything posted by njdubois

  1. Ok, I put the new code it. I guess I'm just going to have to read up on javascript. Thanks again, your solution worked like a charm! Nick
  2. It worked, and I think I see why. When I first load the page, the date changing code that gets added dynamically doesn't exist. So you have to call that function after its been created to attach the calendar stuff. What I don't understand is: $(function() { setDatePicker(); }); What is that doing? Many...many...MANY thanks! Nick
  3. Its clear that my problem lies in the Dynamic created date picker. But I don't know if its the plug in I am using, or if there is something I can code that will get the functionality I'm looking for working. One of the examples in the links provided above: Seems like the direction I need to go, but I can't get this implemented into my code. I'm still unsure where I need to go with this?
  4. If I remove the first date picker, the one inside the div works. My solution lies inside the second link I found. Will post if I solve. Nick
  5. UPDATE: It seems as if the div has something to do with it? I updated the sample page to include a div example. <form> This one is inside a div and does not work?<br /> <div name="divTest" id="divTest"><input id="popupDatepicker_cur_date" name="popupDatepicker_cur_date" value="" /></div> </form> Nick [EDIT] I've found something on google: http://stackoverflow.com/questions/10759193/jquery-datepicker-not-working-in-added-div Which led me to: http://stackoverflow.com/questions/1059107/why-does-jquery-uis-datepicker-break-with-a-dynamic-dom But these are confusing me more than anything?
  6. I am not sure what the problem is, so I am unsure what to google! What I am trying to do is. Inside a form tag, I have a div. This div's contents are a button titled "change date" that calls a javascript function that changes the innerhtml to that of a javascript date dropdown/selecter/calendar. As well as a button thats titled "Save new date" that calls another function that switches a current date to the new date. The problem is, that calendar doesn't work when I insert it with javascript. You can see what I am talking about with the following. The source code looks like this: <!DOCTYPE html> <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <style type="text/css"> @import "caltest2/jquery.datepick.css"; </style> <script type="text/javascript" src="caltest2/jquery.datepick.js"></script> <script type="text/javascript"> $(function() { $('#popupDatepicker_cur_date').datepick({ onSelect: function() { $('#calendar').submit(); } }); }); function change_date() { document.getElementById("output").innerHTML='<input id="popupDatepicker_cur_date" name="popupDatepicker_cur_date" value="" />'; } </script> </head> <body> <form> This one works!<br /> <input id="popupDatepicker_cur_date" name="popupDatepicker_cur_date" value="" /> </form> <br /><br /> <form> Clicking this button, uses Javascript, and innerHTML to set the divs contents to the same line of code used above.<br /> This time, it doesn't work?<br /> <input type="button" onclick="change_date();" value="change" /> <div name="output" id="output"></div> </form> </body> </html> You can see this code live at: http://www.marcomtechnologies.com/test_j.html Can anyone point me in the direction as to whats going wrong? The console doesn't say anything and I can't think of any solution to this problem! Thanks in advance! Nick
  7. Is there a way to determine what caused the change event. IE, did the user click on an item? Or was the select tabbed to and the user pressed the down key a few times? Thinking about this a little. I guess I could use keypressed and trap the enter key and use the trapped enter key to save the selected item, and then use onclick. Store the value of the select when it was clicked, and wait for that value to change when they click it again. Ok. I did some testing. I believe I got the functionality I'm looking for. This is in my select tag: onkeyup="training_key_press(event,this.name,this.value);" onfocus="clear_state(this.name);" onclick="test_for_change(this.name, this.value);" var last_value; function test_for_change(nme, str) { clear_state(nme); if(last_value=="") { last_value=str; } if(str!=last_value) { add_training_item(str) last_value=str; } } And I set last_value to the current value in the select when I press any key. So this way, they can hit the down key, it sets last_value to that value, when they hit enter, it calls add_training_item. And if they need to use the mouse, last_value will be set to the current value of the select, and be able to test against that when they do first click on the select. This is my solution to this problem. If there is a better way to achieve this do let me know! Thanks for the reply! Nick
  8. I have a data form that sends each field to a php file to be saved to the database via AJAX. There is one select/dropdown on this form that is being troublesome. This select adds the selected item to a listbox below. They either click it and then click the item they want and it adds it to the listbox. Or they tab to it and hit the down key to the item they want and it adds it to the listbox. If I were to program in the ability for only one of these options to work I can make it work no problem, But I can't figure out where to even start having to account for both options. onkeyup="training_key_press(event,this.name,this.value);" onfocus="clear_state(this.name);" training_key_press is: function training_key_press(e,nme,new_item) { var key_pressed=e.keyCode? e.keyCode : e.charCode clear_state(nme); if (key_pressed==13) { add_training_item(new_item); } } And all clear_state does is change the icon next to the current object to an explanation mark stating that something has been changed and its waiting for you to be done to save it. Shown above is how I do it if they didn't use a mouse. If I added onchange, it would work with the mouse but then every time they hit the down key it would add that item to the listbox. Onclick will add the last selected, and the newly selected. OnBlur wont work, because they might add 2,3 or 4 maybe more items. Using an add button next to the dropdown is NOT an option. So my question is, can you determine if when the dropdown(select) was clicked on, was the dropdown menu open and clicked on, or was the little down button clicked on? This would be nice because then I can trap that they selected something! If this isn't an option, whats the best way to handle this? I'm confused! Thanks so much! Nick
  9. Thanks! SELECT Session_Date FROM `Call_Record` WHERE STR_TO_DATE(Session_Date,'%m/%d/%Y')>'2013-01-01' AND STR_TO_DATE(Session_Date,'%m/%d/%Y')<'2013-01-10' Worked perfectly! Many thanks!! Nick
  10. This works : SELECT cast(STR_TO_DATE(Session_Date,'%m/%d/%Y') as date) as cur_date, Session_Date FROM `Call_Record` It returns a LOT of results. But this doesn't: SELECT cast(STR_TO_DATE(Session_Date,'%m/%d/%Y') as date) as cur_date, Session_Date FROM `Call_Record` WHERE 'cur_date' > "2011-02-01" and 'cur_date' < "2012-02-08" It returns 0 results even though there are hundreds of dates that fall with in that range. I originally had: SELECT STR_TO_DATE(Session_Date,'%m/%d/%Y') as cur_date, Session_Date FROM `Call_Record` But adding the WHERE returned 0 results, so I tried adding the cast stuff, and it still didn't work. I have also tried using: WHERE 'cur_date' between "2011-02-01" and "2012-02-08" Any idea what I am doing wrong? Thanks a million! Nick
  11. Awesome! You answered my next question, and I figured out why my function wasn't firing. Thanks sooo much! Nick
  12. Using an html5 audio tag, I want to trap when a user clicked play, and when (or if) a user clicked stop. This is what I have In my php : <audio controls="controls" name="audio_player" id="audio_player" onclick="javascript: test_for_play(this);"> <source src="audio_upload/' . $filename . '" type="audio/mpeg" /> '.$audio_ABC_html.' </audio> And in the head I have : <script type="text/javascript"> function test_for_play(var name) { window.alert('Message goes here'); } </script> But I don't ever get the pop up? I'm doing one thing at a time, and I can't move forward until I get this function firing when the user clicks a button on the audio tag. Thanks for the help! Nick
  13. I have a database that uses the MM/DD/YYYY format for dates. With out the option of changing the date format inside the database, whats the best way to pull data based on a range of dates? What I have been doing is using or SELECT * FROM TABLE WHERE user_name='whatever' AND Session_Date='01/01/2012' OR user_name='whatever' AND Session_Date='01/02/2012' OR user_name='whatever' AND Session_Date='01/03/2012' OR user_name='whatever' AND Session_Date='01/04/2012' OR user_name='whatever' AND Session_Date='01/05/2012' OR and so on. The problem is, if we go much farther past a few weeks, it takes to long. We are trying to run it for the year, and that's obviously not working. I have been meaning to change the data format, but the problem is that format dates a while back. We used it in an access database with vb years ago, and when we switched over to HTML/PHP/MYSQL I didn't know there was a better format. Now this date format is all over the site, and to change it is kind of a project. There is plans for a site revamp. As I said, its been a learning process for me. I have recently started testing a setup where key parts of each page that are used almost everywhere are put in an included php file instead. When that's done, a switch like this would be easy but until then I need a way to make this work. Any suggestions? As always, this site and community has been a huge help for me, many many thanks! Nick
  14. I'm trying to do a bulk find and replace for about 50 php scripts I've written, so I built a simple vb.net program to do the work. The problem is that when I upload the new files that have been outputted from vb.net, the format of the text is causing issues : Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent the first 2 lines of the php script look like this: <?php session_start(); If I open the file in win_scp, delete the new line after php, and hit enter. Save the file, and it works fine. I've done a little research on this, and found: "encoding file type is UTF-8 without BOM." How do I get my.computer.filesystem.writealltext(file,append, ENCODING) to output files in that format? My.Computer.FileSystem.WriteAllText(fi.Name, file_text, False, Encoding.UTF8) isn't working. I still get the header errors from the php. I know this is more a vb.net question, and I have already posted in a correct forum for that as well. Still, any suggestions? Thanks! Nick
  15. Thanks for the excellent replies! First I'll catch you up. I copied everything over to a Microsoft Shared Host I have for my band with Godaddy earlier. It still links to the marcomtechnologies.com mysql database, so I was able to just copy it all over and go. I logged in, did some list generating and various other things, and of course it flew. Probably faster than it ever was on the Linux Shared Host my client has. So it being the actual code seems even more unlikely to me now. Christian, you said some things that have caught my interest. What do you mean by "Profiling your code?" If it means what I believe, to have your code looked at has been an interest to me for a while. My problem is that I am self taught. Been programming with basic and its versions for 15 or so years, with bits of other languages in between. Only school classes where the ones in high school. I don't have any peers that I know and trust that I can have come over and say, no you should have done this that way. Or that's not a good way to do that. Now this site has grown into a huge service. Pages and pages of php and html. I don't feel safe just showing random people on the internet. Any code I post I have to be careful with what needs to be censored. Is there a service that you can sign up for, with some kind of legal agreement protecting us? Could you elaborate on top, iotop, etc? ​Currently, GoDaddy is transferring our site to another Server. Tomorrow we will setup FTP permissions and I will copy the site over. I really think everything is going to be just fine but the problems we have experienced show a whole in my knowledge of the server. I'm sure that it is in my best interest as a web developer to understand how to troubleshoot, test for and diagnose issues. I also want to say this, I wish I had taken time to learn php years ago. My life would be a world different. Thanks for the help, I look forward to the replies. This is taking me down a path I have yet to travel! Nick
  16. I've pinged marcomtechnologies.com from my windows command prompt and its working pretty fast. Normally, going through the basic company page, that is jsut a "this is who we are" with no php is pretty snappy, but click the link to bring you to the login screen and thats when things slow down. Is it possible that its my code? As I said, it worked fine forever and now I'm really worried.
  17. For the past 11 days, my clients shared host with godaddy has been next to impossible to access. It will sit there trying to connect for a minute and then say the page isn't available. Directly from godaddy: "shared servers may experience times of high load!" 11 days of barely being able to use the site is WAY more than times of high load. To make things worse, godaddy is telling us there is nothing wrong on their end. Accessing the database directly isn't a problem, it works nice and snappy. We did add one page, that no one is using but the 2 of us, and it is very light. Also, this page was added maybe a week before the issues started. Right now, if i browse along the base "this is our company" page, where there is no database work, things seem to move around alright. But is that because these pages have no php code, and are rather small and simple, or is it because my code is bad? Right now the page isn't doing to bad, there is still a bit of a delay on php sites. Is there anyway possible that my code would work ok for 2 years, and then like a flip of a switch, we can't access anything? What else could cause this? Maybe its a memory issue on the server? Wouldn't godaddy be able to tell us that? Is there a way to check my current available server resources? how much memory is free for example? Is there a way to test my code? As I said, it worked ok for ever, and then just died. We are both so confused right now. Why is godaddy saying there is nothing wrong, when obviously there is? Are they jerking us around? They are recommending upgrading to a VPS or ded server. We do not believe we have the traffic for that. Would opening my site up to beta testing help? What should my first step be in troubleshooting this? I've thought about copying everything over to my personal microsoft shared host with godaddy and seeing if my code does the same thing. But something tells me that wont be an issue. Please help!!!! SOS!! thanks Nick DuBois
  18. I'm thinking this isn't the best place to ask this. I looked at all the other forums and none of them really fit. My client has had major issues with GoDaddy the past week and a half. He has been in 2 different states trying to sign up new clients and has had major connection issues with the shared godaddy server. To the point where it sits there for minutes before timing out. Over and over and over, all day not just during peeks. Of course, we know, a shared server... according to godaddy, there may be load problems and thats that. They pretty much said, we are sorry to hear that, spend more money and get this. My client wants to leave godaddy, and we both agree to switch over to a vps anyway. The question is who? So since I love this site. you guys rule! I'm asking the question here. Whats your host of choice? Keep in mind I need php/mysql and the ability to use exec() so I can do server side audio file conversions. I'd prefer to have it all setup for me, though I'm sure I could find someone to do it. As always, thanks! Nick
  19. ok, now Firefox and Chrome are good, Safari is alright, IE9 still is a no go. I'm so confused.
  20. http://www.leadfootgearjammers.com/background.php Look at it in any browser but IE9 and it looks great. But IE its like its not scaling it to fit the screen, its as if IE9 is scaling to fit some virtual screen? I don't know, just doesn't look right. [uPDATE] as I write this I'm using this to get my thoughts out of my head and maybe fix it myself. While doing this, I noticed that Firefox is no longer displaying correctly. Its just a band going across the top of the screen [/uPDATE] The code is simple. <html> <head></head> <body style=" background: url('http://www.leadfootgearjammers.com/picture_gal/1353302979-2012-03-02_21-13-14_906.jpg') no-repeat center center fixed; background-size: cover;"> </body> </html> What can I do to get better consistency in most browsers? Right now, Chrome and Safari have it dead on. Firefox is just displaying a band on the top and IE9 shows the top half of the image and you see the hood of the car. I've been up and down google. Most of the problems relate to older versions of IE, and the solutions don't worth either way. I saw -moz-background-size:100% 100%; on w3schools.com but it didn't solve my FF problem. Thank you so much! Nick
  21. I think i did to much to fast in once browser, and should have done each part at a time and tested in each browser. I really bit myself by not checking what I was doing as I did it. Tomorrow I am going to start from scratch, build each element and make it look right in each browser. Maybe tonight I'll do some more reading up on CSS, a little more research never hurt! Thanks for the help guys. I'll keep you updated!
  22. If you wanna see what I'm talking about, look at the site in internet explorer =(
  23. wow, thanks for all the awesome help!! One last CSS question, is there a compatability test app or website? somewhere I can paste my code to see what is causing a problem with what browser? thanks again! Nick
  24. I have a form, with a text box and a submit button. When they click submit it saves to a database. Say the submits name/id is save_button. I use if(isset($_POST['save_button'])) { // do save to database stuff here. } The user clicks save, it saves the database, then for whatever reason hits the Refresh Button. Adding a double to the database. I don't understand how to stop this from happening? Any recommendations? Thanks Nick
  25. an update..... chmod($target_path, 0755); works fine. But I'd still like to know if there is a way to handle this server side? thanks Nick
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.