Jump to content

houssam_ballout

Members
  • Posts

    199
  • Joined

  • Last visited

Posts posted by houssam_ballout

  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. 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

  3. 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 }*/

  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 All,Please can u help me, I've this script it works fine, but what I need is that when the page reaches the end, I want to make it begin from the first and so on Thanks in advance This is the code:<script language="javascript">function pageScroll() { window.scrollBy(0,50); // horizontal and vertical scroll increments scrolldelay = setTimeout('pageScroll()',1000); // scrolls every 100 milliseconds}</script>

  6. Hello all, I am customizing a script that is used on rollover for images, but it wont work , can u help me with it? (there is no problem with images)The code is:

    <HTML><HEAD><TITLE>Multiple Rollovers</TITLE><script LANGUAGE = "JavaScript"><!--if (document.images) {img1On = new Image();img1On.src = "1.jpg"; // Active Imagesimg2On = new Image();img20n.src = "2.jpg";img1Off = new Image();img1Off.src = "2.jpg"; // Inactive Imagesimg2Off = new Image();img20ff.src = "1.jpg";//img1ad = new Image(); //img1ad.src = "1.jpg"; // Information Images//img2ad = new Image();//img2ad.src = "2.jpg";}// Function to 'activate' images.function imgOn(imgName) {if (document.images) {document[imgName].src = eval(imgName + "on.src");//document["holder"].src = eval(imgName + "ad.src");}} // Function to 'deactivate' images. function imgOff(imgName) {if (document.images) {document[imgName].src = eval(imgName + "off.src");//document["holder"].src = "1.jpg";}}// --></SCRIPT> </HEAD> <BODY BGCOLOR = "#FFFFFF"><!-- 1st Rollover --> <a HREF="jukebox.html" onMouseOver = "imgOn('imgl')" onMouseOut = "imgOff('img1')"> <IMG NAME= "imgl" BORDER="0" HEIGHT="24" WIDTH="100" SRC="1.jpg"></A><!-- 2nd Rollover --> <a HREF="videos.html" onMouseOver = "imgOn('img2')" onMouseOut = "imgOff('img2')"><IMG NAME= "img2" BORDER="0" HEIGHT="24" WIDTH="100" SRC="2.jpg"></A></BODY> </HTML>

  7. Hello all,Can someone helps me with the following idea:I've a page with input boxes on it,and beside each input box there is a link that will display a small help text, and that help text will be extracted from the xml file according to the id of the text box, so , I need more help on that , How could i extract data in HTML page from an xml page?Thanks

  8. Hello all, I am creating a web page and have links on it, near each link I want to include some tips so that when the user puts the mouseover them,it retrieves the data from an xml file and display it, I want some help in retreiving the data from the xml file?Thanks

  9. HelloI need to get the page name of the page that I am in using JavaScript , or PHP,I was using $_SERVER['PHP_SELF'], but its returning the url of the link for example its under folder webmin so the result is /webmin/pageName.phpI need to get only pageName.phpany help?Thanks

  10. Hello allI have a form which has alot of radio buttons and check box for each group (4 or 5)I want to enable these boxes when I uncheck the check box and restore it back.can I do with javaScript?any suggestionTHanks

  11. helloam trying to build a class for the tr, but I want to include also the a:visited and. everything about itcan I make a class that include another classThanks

×
×
  • Create New...