Jump to content

adam84

Members
  • Posts

    289
  • Joined

  • Last visited

Everything posted by adam84

  1. Awesome, Thank you very much. It seems to be working as expected
  2. Hello, I am having an issue and I not quite sure why it is happening or how to get it to work. What I am trying to do is resize the dialog to fit the screen when the mobile device is in portrait or landscape view. So I wrote the code to create the dialog, that works fine. It appears, disappears and is sized correctly upon creation var myDialog = $("div.myDia1").dialog({ autoOpen: false, resizable: false, modal: true, show: 'drop', hide: 'drop', width: $(window).width()-25, height: $(window).height()-25, open: function(){ $("div.myDia1").css("z-index", 105); } }); This is where the problem is happening. I have my function below that gets called once the device gets rotated. When I test the application with the following code, nothing seems to happen. The dialog stays the same size. $(window).on("orientationchange",function(){ $('div.myDia1').dialog( "option", "width", $(window).width()-25 ); $('div.myDia1').dialog( "option", "height", $(window).height()-25 ); }); I assumed that the function wasn't being called at all, so I put an alert into the function and once I did that, the function seemed to be working properly. The page loads, I open the dialog and rotate my phone from Portrait to Landscape, the alert appears, then the dialog gets resized to fit the screen. I them rotated the phone back from Landscape to Portrait, the alert appears, and the dialog get resize to fit the screen $(window).on("orientationchange",function(){ alert('Here I am'); $('div.myDia1').dialog( "option", "width", $(window).width()-25); $('div.myDia1').dialog( "option", "height", $(window).height()-25 ); }); So..... I am wondering why the function only works with the alert and what I can do to get it to work without the alert being there. Thanks in advance
  3. Hello, I need some help with a problem I am having. I have a site where a user can post a document and others can purchase it. My problem is how do I allow access to the document only once it is purchased? My current direction: When a user uploads a file to the site, the document goes into the main repository. When a user creates an account, a folder is also created on the server and named the user id for distinction. When a user purchases a document, the document is logged into the database (where I keep track of all the purchased documents) and a copy of the document is moved into the user’s folder from the main repository. Once the document is read or the time expires (i.e. 30 minutes from purchase), the document is removed from the user's folder and they cannot access the document again. Thoughts - I will have multiple copies of the same document saved on the server. (n)+1 documents. That might get out of hand. - If I get 1 million users, that means I will have 1 million user folders on the server - Im not concerned with the user downloading the document, the main issue is denying them access until purchased. What about storing the documents into the database? Is it better to load the content to a table or the save the actual document on the server? Thanks,
  4. Hi, I wrote a regex that will look for alphanumeric values only. /^\w+$/ What is happening is I am reading some data from a file and sometimes there is data that is invalid and it shows up as a square box. I am trying to develop a regex statement that will look for a character that is not [a-zA-Z0-9]. Any ideas on what I can do to make this work? Thanks
  5. Hello, I made a web application(PHP) that works with another application that was made(VB). In the web application, the user can enter a bunch of text and behind the scenes, I want to add some extra text to the end of the user entered text. My problem is when I add my extra text, i want a couple new lines that space out the two paragraphs of text, but if I enter the new line as <br /> or \n or \r or chr(13) or chr(10), nothing happens when I open it up in the VB program. There are not any new lines and somethings the actual characters '\n' show up. Does anyone know of a special character that I can enter to create the new line so that it shows up correctly in VB?
  6. I am using JQuery to capture a signature. It works well on my local computer. When I browse to the page on my cell phone, when I go to sign my name, my finger on the screen causes the screen to jump around and I cannot fully sign my name. I was just wondering if someone has encountered this before or knows a solution to this problem
  7. Hi, I just to know if there is a standard screen resolution that I should use when programming my site? Im programming in 1440x900, but sometimes I use an older computer that is 800x600. The results look different, is programming in 1400x900 a good idea, or should i use a screen resolution that s somewhat in the middle of the spectrum? Thanks
  8. I am trying to only allow letters, hyphens, periods and spacings Any suggestions would be helpful. function checkName( $name ){ if(!eregi("[a-zA-Z.' ]+", $name)) return false; return true; } Thank you
  9. There is some javascript code that I over looked that caused it to overwrite the css of something, any ways I commented out a line and everything is all good and handy, thanks
  10. Solved, In the sortable:receive function, I need to use $(ui.item).attr('id') to get the current ID of the item being 'sorted'. Then I didnt need to use the droppable function which for some reason wasn't always getting called. Nonetheless, it works and all is well, thanks
  11. It still gives me an error. But after some testing, I think I know what the promlem is, but I am not sure what to do to fix it. I am using droppable, and when I drop an item, i use the 'drop' function. In that function I get the ID of the div I dropped and store it in a variable. I am also using sortable, I use the 'receive' function, in this function I parse the stored ID, because it is made up of two other ID. My error happens during the parsing of the stored ID. What I think is happening is that the droppable function is not getting called, so it is not stored that ID I need. The only fix I can think of is to get the item ID in the sortable function, but I couldn't find a solution to get the value I needed. Any ideas?
  12. Hmmm, I am using JQuery. my code is like this <html> <head> all my js and css imports here </head> <body> html code </body> </html>
  13. I thought it might have been the cache, so I added something into the header section. Since I added that, the same issue has been happening, so I don't believe that was the problem. I believe everything is loaded because, I can drag items around my page just like normal, but the problem is when I drop the item, I try to get the ID of the dropped item, but when I alert the ID, nothing shows up, but if I refresh the page multiple times, it finally goes.
  14. Hey, I am using JQuery, draggable and sortable on my site. The user does whatever they do and if they made a change I use ajax to update my database with the changes. I also do a page refresh every 60secs, and once the page refresh my JQuery functions stop working. When I drop an item, I want to id to be alerted. Before the refresh the page works fine, but after the refresh nothing gets alerted. To get the page working again, I need to refresh the page mulitple times manually. Anyone ever have this issue before? $( ".weekday" ).droppable({ drop: function( event, ui ){ alert($(ui.draggable).attr("id")); } });
  15. The #blank div, turns the background dark, the #popUpDiv is the div that appears. I call a javascript function that makes changes the bg dark and makes the popup appear
  16. Hi, I am trying to create a CSS popup. I have provided my code below. I want to have the popUpDiv appear in the top left corner of the screen. But for some reason it appears in the middle of the screen. Any ideas on what my issue is? Thanks HTML <body> <div id="blanket" style="display:none;"></div> <div id="popUpDiv" style="display:none;"> <div name="updateDIV" id="updateDIV"></div> </div> <div name="content" id="content"> text </div> </body> CSS #blanket { background-color: #111; opacity: 0.65; filter: alpha(opacity=65); position: absolute; z-index: 1; top: 0px; left: 0px; width: 100%; } #popUpDiv { position: absolute; left: 900px; top: 600px; background-color: #eeeeee; width: 900px; height: 600px; z-index: 2; }
  17. On my page I was a calendar, where a user can drag and drop their tasks to different days, when they do that I have css popup gets displayed that contains a div tag called 'content'. When that popup happens, i use ajax to call a php script and return informaton into the content tag on the css popup about that task that is being moved. My problem deals with the use of JQuery in the data that is being returned. I am using JQuery to create a calendar so the user can edit the date/time if they want. The JQuery does not work when the information is returned into the content div. If I call the php script directly everything works fine. If I were to call the JQuery calendar anywhere except within the ajax returned data, then there is no problem. Any ideas how I can get around this?
  18. How do you suggest I made the div element re-draggable?
  19. Hi, I want to make a div tag draggable. The div tag(the one I want to drag) gets populated into another div tag from an ajax call that I do on init and every 60secs. My problem is that I cannot make the div tag draggable. Is this possible to do? To test, I added a div tag on my index page above the tag where I load my content and I can move that one anywhere, but the tags that are ajax loaded do not seem to want to move? Any ideas?
  20. Thank man, but its not working at all. The color is saved as a long from VB and I want to covert it using PHP
  21. Hey, We have a software program, where a user can set the color of different tasks and stuff. When the save it, the value in the database is an int. How would I go about converting that into a hex value. Red: 255 Green: 33280 Grey: 13026246 Any ideas, thanks
  22. I am using SQLSRV to access my Database. I receive the correct value, I just cannot do anything with it because it is a date. I cannot even explode the returned value because it says its type date not type string
  23. Howdy, I have a question about Dates in PHP 5.3.6. I queried my database (SQL Server 2008) and I got back two columns, a date(StartDate) and a time(StartTime). The software we used only allows the user to enter a StartDate, so that field always has a value, but there are instances where the StartTime is null (no time set). What I want to do is if there is a StartTime, concat it to the StartDate. If there is not StartTime, I want to add a default time. But when I do that, I get an error saying that I cannot combine a string and a date. I really do not understand why this is happening. I set up PHP 5.3.6 on a server, so I am not sure if there something in the php.ini file that is not allowing me or if this is something new. Some help please! Thanks if( $row['StartTime'] != null ) $sTime = $row['StartDate'] . " " . $row['StartTime']; //What I want '2011-05-03 17:58:12.000' else $sTime = $row['STartDate'] . " 00:00:00.000"; //What I want '2011-05-03 00:00:000'
  24. I now get the following error when I run the script/ PHP Fatal error: Call to undefined function sqlsrv_connect()
×
×
  • 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.