How to auto-focus an text feild

by MYLE 3. August 2010 21:12

Ever want to check a text feild on a web site and not let you got to the next step

I have to text feilds fd_password and repassword they must be the same

 

 

function checkPass(){ 
  var guess = document.myform.fd_password.value;
  var secret = document.myform.repassword.value;

  if (guess == secret){
    
  } else {
    alert("Please check Passwords");
    setTimeout("focusElement('myform','repassword')", 0);

  }
}


 function focusElement(formName, elemName)
   {
        var elem = document.forms[formName].elements[elemName];
        elem.focus();
        elem.select();
    }

 

this will keep focus the repassword feild until it the same

Then in the onblur of the feild to check put this

 

onBlur="checkPass()"

 

 

TinyMCE - Javascript WYSIWYG Editor

by MYLE 10. July 2010 01:57

its Cool easy to setup

Download From Here 

Only Problem Its a PHP code for the file management well that not a problem well There are work around for it

My first on is Little change

there is a Imagelist in the imagepopup that needs to be full

So this script will read all image in a folder and put them into a array so that the TinyMCE can read it.

folder = iif(trim(uploadsDirVar)="","D:\WWW\mel\Photos",uploadsDirVar)
ImgList  = server.MapPath("image_list.js")
writeTofile ImgList,"var tinyMCEImageList = new Array(",false
'folder = uploadsDirVar
set fso = CreateObject("Scripting.fileSystemObject") 
set fold = fso.getFolder(folder) 
aa=0
zz=fold.files.count
for each file in fold.files 
aa = aa + 1
writeTofile ImgList,"['" & replace(ucase(file.name),".JPG","") & "', 'Photos/" & file.name & "']" & iif(aa=zz,"",","),true 
Next
writeTofile ImgList,");",true

function WriteToFile(FileName, Contents, Append)
	on error resume next
	if Append = true then
	   iMode = 8
	else 
	   iMode = 2
	end if
	set oFs = server.createobject("Scripting.FileSystemObject")
	set oTextFile = oFs.OpenTextFile(FileName, iMode, True)
	oTextFile.Write Contents & vbnewline
	oTextFile.Close
	set oTextFile = nothing
	set oFS = nothing
end function

Function IIf(Condition_To_Check,TrueBit,FalseBit)
	If Condition_To_Check Then 
            IIf = TrueBit 
        Else 
            IIf = FalseBit
        End If
End Function

...

Now You need to point  TinyMCE to the right place look in the tinyMCE.init

look for

external_image_list_url : "lists/image_list.js",

change it to point to the same place where "ImgList = server.MapPath("image_list.js")" is point to

in my case its in a inc Folder so

external_image_list_url : "inc/image_list.js",

Done Tongue out

 

 

 

Breadcrumbs on a Site

by MYLE 30. June 2010 00:51

 

find these for this Blog Engine

  • Historical Breadcrumbs - Shows the last few pages visited
  • Hierarchical Breadcrumb Extension - Shows the user where they are on your blog
  • [Quoted : From webMonkey web site]
    There are two main ways of approaching breadcrumbs. The first is the kind left by Hansel and Gretel, which is of the form, 'I went here, then here, then here, then here'. I've labelled this kind of breadcrumb, 'History Breadcrumbs', because they show a browsing history.

    The second is of the form, 'I'm at this page, which is part of this section, which is part of this section'. I've called this kind 'Position Breadcrumbs' because they show the visitors current location in the site.

    [/Quoted]

    Webmonkey Javascript Version  Wink Has my Vote

    been a VB Man I wanted a ASP version as 

    Found the "Breadcrumbs for Those Using ASP"
    Like the coding tidy easy to follow but The thing I did't like was you had to use a PageTitle  

     

    Java Script POPup that center on screen

    by MYLE 23. June 2010 17:10
    One I don't like is when some create a popup window and it not in the center of the screen so I wrote this Popup javascript function to do the job for me center it
    function PopupIt2(url,width,Height)
    //************************************************
    // OPEN A POP WINDOW 
    //************************************************ 
    { 
    // alert('h=' + window.screen.availHeight);
    var popupWidth = (window.screen.availWidth / 2) - (width / 2); 
    var popupHeight = (window.screen.availHeight / 2) - (Height / 2); 
    var popupTop = popupHeight var popupLeft = popupWidth 
    // THANKS ROBIN MY SON FOR THE HELP FOR THIS 
    // alert('popupHeight = ' + popupHeight);
    // alert("top=" + popupTop + " , left=" + popupLeft + " , width=" + width + " , height=" + Height + " location=No,scrollbars=yes,status=no,menubar=no"); 
    popupwin = window.open(url, "new_page","top=" + popupTop + " , left=" + popupLeft + " , width=" + width + " , height=" + Height + " location=No,scrollbars=yes,status=no");
    popupwin.focus();
    }
    
    add JavaScript:PopupIt2('url',width,height) to the href of the A where the width is the width of the screen and the height been the height of the new popup watch this space have and other one that will popup a Image the right size have to find the code LOL

    Dislexia

    I see people have commented about my style of writting.
    Well I have dislexia so spelling is not one of my good points
    but when it comes to reading/written code thats the easy bit.

     

     

    Poll

    What Search Engine Do you use




    Show Results

    Disclaimer of Liability

    While every effort will be made to ensure that the information contained within this website is accurate and up to date, The Company's listed with this web site and any associated parties, make no warranty, representation or undertaking, whether expressed or implied, nor does it assume any legal liability, whether direct or indirect, or responsibility for the accuracy, completeness, or usefulness of any information.

     

    Google Ads

    Most comments

    carpet cleaning forest lake carpet cleaning forest lake
    1 comments
    us United States
    carpet cleaning capalaba carpet cleaning capalaba
    1 comments
    us United States

    RecentComments

    Comment RSS