Jump to content

houssam_ballout

Members
  • Posts

    87
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

houssam_ballout's Achievements

Member

Member (2/5)

0

Reputation

  1. Hello, I had this issue in mysql: I had made a query which select data from 3 tables, using UNION command, and its getting the results, when I want to display the results in a php page , I need to know the table that each record had been retrieved from, how can I do it? Thanks in advance
  2. Here it is, problem now, is that when I write 4-5 or 4-5- I need to autocomple the year with the current year: var dtCh= "-"; var minYear=1900; var maxYear=2100; function isInteger(s){ var i; for (i = 0; i < s.length; i++){ // Check that current character is number. var c = s.charAt(i); if (((c < "0") || (c > "9"))) return false; } // All characters are numbers. return true; } function stripCharsInBag(s, bag){ var i; var returnString = ""; // Search through string's characters one by one. // If character is not in bag, append to returnString. for (i = 0; i < s.length; i++){ var c = s.charAt(i); if (bag.indexOf© == -1) returnString += c; } return returnString; } function daysInFebruary (year){ // February has 29 days in any year evenly divisible by four, // EXCEPT for centurial years which are not also divisible by 400. return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 ); } function DaysArray(n) { for (var i = 1; i <= n; i++) { this = 31 if (i==4 || i==6 || i==9 || i==11) {this = 30} if (i==2) {this = 29} } return this } function isDate(dtStr){ var daysInMonth = DaysArray(12) var pos1=dtStr.indexOf(dtCh) var pos2=dtStr.indexOf(dtCh,pos1+1) var strDay=dtStr.substring(0,pos1) var strMonth=dtStr.substring(pos1+1,pos2) var strYear=dtStr.substring(pos2+1) strYr=strYear if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1) if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1) for (var i = 1; i <= 3; i++) { if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1) } month=parseInt(strMonth) day=parseInt(strDay) year=parseInt(strYr) if (pos1==-1 || pos2==-1){ alert("The date format should be : dd-mm-yyyy") return false } if (strMonth.length<1 || month<1 || month>12){ alert("Please enter a valid month") return false } if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){ alert("Please enter a valid day") return false } if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){ alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear) return false } if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){ alert("Please enter a valid date") return false } return true } function ValidateForm() { var dt=document.getElementById("ADate"); var currentTime4 = new Date() var month4 = currentTime4.getMonth() + 1 var day4 = currentTime4.getDate() var year4 = currentTime4.getFullYear() var finalDate4 = ( day4 + "-" + month4 + "-" + year4 ); if(dt.value == '') { dt.value = finalDate4; } if (isDate(dt.value)==false) { dt.focus() return false } return true } /*function ValidateForm(){ var dt=document.frmSample.txtDate if (isDate(dt.value)==false){ dt.focus() return false } return true }*/
  3. I had the code for the validation dd-mm-yyyy but the auto complete is missing & when the field is empty is also missing! Thanks
  4. Hello, I need the help on the following in order to validate date on my form (validation is onBlur): - validation on form date format: dd-mm-yyyy , when I go to next field, if the date field is empty, it will be filled with today's date, and I write 9-3 and go to next field it will automatically write 9-3-2013 (where is 2013 is the current year), finally, if the date is not valid then user can't go to another field, focus must be go back to date field. Help is much appreciated. Thanks in advance
  5. Hello, I had the following issue and I need your assitance in it: I had a drop down box which list the customers (from customers table), when the client select another client, I need to change the contetnt of another text box (which is the value get from BalanceTable) Any assistance? Thanks
  6. but I need help with mute/unmute toggling thanks
  7. It gives some life to the website & my friend asked me to do this
  8. Hello, I need help with putting music background on the html page with the mute button. Thanks
  9. Hello, I need help with this issue, I am displaying <a href='index.php?cat=h & r'>text</a> when I do print $_GET['cat'] it only displays h, why ? Thanks
  10. Hello, I had this case: Text is stored in mysql table in the means of html, i.e. it contains <p> ,<br /> .... I want to display it on a php page, I had 2 questions: I want to display the first 400 characters, then the second 300 each on different <div> , so I need to save them each on different variable? and what about html tags? Thanks
  11. Well, after I get variable from mysql , they are stored in php variable within a loop. Any help is much appreciated. best
  12. Hello, I need help with the following: I had a dynamic variable in this form: XXXX-Y-A-B (which is called ID) XXXX is always fixed (character) Y is also a single character A is an integer B is an integer I am quering a database that had list of that IDs , and I need to know the value of A each time (A could be 1, 2, 3, 11, 200....) Any help? Thanks
  13. they are on the same domain, should I put the code in the popup? Note that the popup is like any other page.... thx
  14. Hello, I had a normal page which contains some link that will issue a popup window. I want to refresh the main page when the pop page being closed, any help? Thanks in advance
×
×
  • 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.