Jump to content


  • Posts

  • Joined

  • Last visited

houssam_ballout's Achievements


Member (2/7)



  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. I meant, when I select an item from the dopdown it will show 2 textboxes, and when I select another dropdown it will hide those 2 textboxesThanks
  3. Is there any example available to help me
  4. Hello,i had the following scenario in which I need your help: I had a drop down box: <option value="client-all.php">1</option><option value="supplier-all.php">2</option><option value="koshofat.php">3</option> <input type="button" onClick="location=document.koshofat.URL.options[document.koshofat.URL.selectedIndex].value;" value="go" class="button2"> its good for 1, 2 , but I need to show 2 textboxes when the user select 3 and hide them when user select different than 3 (After that when he click submit, I will get the values through POST variables), I need your help in scripting my issue? Thanks in advance
  5. 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() + 1var 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 }*/
  6. 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
  7. 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
  8. Hello,I had a html form that I want to let enter key to act as TAB key in html form. Thanks in advance
  9. Hello,I need your help on the following:I had a page that I want to make it password protected using Javascript which is fine, but I want to be able to change the password when I login to that page, is that possible? Thanks
  10. Hello,I was looking at : http://www.w3schools.com/sql/sql_join_full.aspBut I want to display unique records, how can I achieve this?Thanks
  11. 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
  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 characterA is an integerB 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. Look at this example under confirm:http://labs.abeautifulsite.net/archived/jquery-alerts/demo/I need help in making it in <a href=""></a>also, my current code makes look from the database, so in the current code, with the <input type="button" id="confirm_button"> it will work with on button only.Thanks
  14. Hello all,I was searching for a javascript in which I can change the confirm box title, I had found this http://www.abeautifulsite.net/blog/2008/12/jquery-alert-dialogs/but I need help how to make it on a hyperlink, as in my page, I had <a href="test.php?action=del&id=1>Delete</a>the above link works perfect with button, how can I make it work on a href so that when I click on the Delete text, I get the confirmation with Yes , Cancel option, when clicked Cancel, it will do nothing and Yes will delete the record
  • Create New...