Jump to content

jimfog

Members
  • Content Count

    1,777
  • Joined

  • Last visited

Everything posted by jimfog

  1. well the code works...I did not expect to work cause I had made some assumptions--which were wrong of course...I have 2 questions though. why not do this with PHP enbedded in the HTML...why resorting to JS...something like this: <div <?php echo ($schedstatus == 1) ? "style='display:none;'" : "style='display:block;'" ?> id="modal">...... I have come to understand that code in a JS file tha resides INSIDE the document on load function...runs after the HTML/document is loaded...that said the modal should be shown(my assumption) and hidden WHEN the code insid
  2. I have a textarea form that the user fills to inform why he/she is closing its business...no more than 200 chars. Suppose that he goes to edit that and clicks the cancel button..in such a case whatever he/she has typed must be replaced by the original text. this original text comes from the database and must be available somehwere in the DOM(in case it is needed such as the case of cancel). I was thinking the data attr but for various reasons I do not think you can store there so much text... What are my alternatives?
  3. Depending on a specific value taken from the database....a popup is hidden or shown in a page. The htlm of the popup is there but when the value is true(that comes from the db) with jquery I hide it. That is I get the value in JS....the problem with this approach is that(in case the popup is to be hidden) on page refresh the popup appears for less that a second and then disappears. Bad for UX. How I could make it that when the popup is hidden does not appear at all on refresh. Iis it better maybe to handle it server-side? I hear opinions.
  4. jimfog

    mvc or no mvc

    I am not coding based on MVC...my progect is not big...it works though..ok it is not the cleaner solution...but I am in a tight schedule...is there a compelling reason to change the code to MVC...what do you think?
  5. I am building an app where a table holds business users-businesses data: CREATE TABLE `business_users` ( `crID` mediumint unsigned NOT NULL, `bus_user_type` smallint DEFAULT NULL, `pack_selected` smallint unsigned NOT NULL, `sched_entered` tinyint(1) DEFAULT NULL, PRIMARY KEY (`crID`), KEY `fk_business_users_buz_usertype1_idx` (`bus_user_type`), KEY `pack` (`pack_selected`), CONSTRAINT `fk_business_users_buz_usertype1` FOREIGN KEY (`bus_user_type`) REFERENCES `buz_usertype` (`Type_id`), CONSTRAINT `fk_business_users_users1` FOREIGN KEY (`crID`) REFERENCES `users` (`
  6. You are absolutely right....do not know what I was thinking... This is better now https://jsfiddle.net/fiddlehunt/Lnt74wje/62/ Still I must do it like this-your sugestion is better:
  7. Ι do not get it....do you mean something like this https://jsfiddle.net/fiddlehunt/Lnt74wje/45/ The results are not the desired...
  8. thanks...there is one last detail. when the user clicks the doc radio and then some other radio the search box stays there(unwanted)...AND subsequent clicks of the doctor radio(after clicking othe radio buttons) displays many search boxes in the DOM-besides the doctor radio button. How to tackle these two. I have thought some solutions but I want to hear your opinion.
  9. take a look at this fiddle https://jsfiddle.net/fiddlehunt/Lnt74wje/18/ Select the doctor radio button to see what happens...an input box appears in a place I do not want. I want it to appear right besides the radio button/text...as shown in the image snapshot below I thouht that enclosing the image input/label on a span tag(which is inline element) would the trick...but it does not. Furthermore the label is set to display block by the css code...it is this which creates the problem in the first place. Any ideas...
  10. No it is not found twice in the DB. Meanwhile I made a little search and what finally solved the issue is that intead of tracking keyup I used the input event...that solved it. Follows part of the event handler(JS) so you can understand what I am talking about. $('#search').on('input', function(e) { e.preventDefault(); var searchKeyword = $.trim($(this).val()); if(searchKeyword!=='') {//// tell me what you think...
  11. Make it more clear to me cause I am confused. Are you asking if the name Nikos Pistolou is found twice in the DB... is this what are you asking?
  12. this is the sql query allthough I think the problem does not lie there...the query as you see is rather complex The function that performs the connection to the database is passed in $conn(I can show the code but I do not think is neccesary.) SELECT IF(u.lastname IS NULL,b.comp_name,CONCAT(u.name, " ", u.lastname)) AS name,u.user_ID, t.user_type, b.sched_entered FROM users u JOIN business_users b ON u.user_id=b.crid JOIN buz_usertype t ON b.bus_user_type=t.type_id WHERE u.active = 1 AND b.sched_entered = 1
  13. probably is a JS issue...relatedd to the event handler
  14. maybe the IF statement must go in the JS code...just thinking.
  15. An IF statement in the sql query or in the php code? I suppose you mean in the PHP code. More importantly what this code will do…I cannot understand…please explain. Here is the code: $arr = array(); if ((isset($_POST['searchKeyword']))&&(!empty($_POST['searchKeyword']))) { $results=search($conn,$_POST['searchKeyword']);//funcction to perform the search operation if($results!==false) { echo json_encode($results);//array με τα αποτελέσματα } else { echo 'false'; } }
  16. I have built an SQL query that when some criteria are met retrieves data from a database and present is to the user as search results....is is a search query in the words. Consider the following when the uset types the letter p in the searh box the following name is retrieved Nikos Pistolou...which makes sense as there is such name in the DB....upon pressing p an ajax call is made. And here is my problem When the user presses shift+p (that capital p) 2 ajax calls are made and as a result the above name appears twice.......an unwanted behaviour. What can be causing this and
  17. jimfog

    code cleanup

    Where can I upload the code? No I am not usingg MVC
  18. jimfog

    code cleanup

    You are asking me to create a fully functional PHP page...where I can do that? I am just asking
  19. jimfog

    code cleanup

    if((isset(get[package]))or(isset[submitbuzusersolo])or(isset[submitbuuser[multi]])) { if(isset(get[package]))AND(get[pakage])==solo)AND(isset[submitbuzusersolo]) { //display package/payment image if(isset[submitbuzusersolo]) {//make vaidation checks} //display form } if(isset(get[package]))AND(get[pakage])==multi)AND(isset[submitbuzusermulti]) { //display package/payment image if(isset[submitbuzusermulti]) {//make vaidation checks} //display form } } else { //display pakage/payment images } Take a look at the above
  20. I want your opinion on a very confusing matter(at least for me)....I use Netbeans as an editor. Netbeans has a history feature...code changes are tracked...somehow,it is very basic/simple-it does not offer of course the features of Git. Aparth from that..it does it's job though very good. While coding I find my self many times in the dilemma in using git or Netbeans as atracking tool...sometimes I create git commits,,,,sometimes I use the history feature of Netbeans. This situation is not the optimal of course for coding... So,I want your opinion on the natter...if you
  21. jimfog

    hard refresh

    and how the above differs from emptying the cache? This is what confuses me.
  22. jimfog

    hard refresh

    Why sometimes soft refresh is not enough to refresh the content of a page and a hard refresh is needed instead? Thanks.
  23. I am finally getting it...a parent element is different from an ancestor somehow...there is an overlap though in some cases. here is what I want to do: When the user clicks a menu item I want the arrow to appear directly below that menu item. Now clicking the mails(I do not use a click handler in the fiddle,a placed the arrow image inside a menu item just for demo purposes so as to find the problem) item the arrow appears somewhere else.... What do you propose?
×
×
  • Create New...