Onfocus and onblur, PHP Web Programming

Assignment Help:

The onFocus event handler executes the mentioned JavaScript code or function on the occurrence of a focus event. It is while a window, frame or form element is given the focus. It can be caused through the user clicking on the current frame, window, or form element, using the TAB key to cycle through the several elements on screen, or a call to window .focus method. Be aware that assigning alert box to object's onFocus event handler will result in recurrent alerts as pressing the 'OK'

<SCRIPT LANGUAGE="JAVASCRIPT">

s1 = new String(myform.myText.value)

function changeVal() {

s1 = "I'm feeling focused" document.myform.myText.value  = s1.toUpperCase()

}

</SCRIPT>

</HTML>

2452_OnFocus and onBlur.png

Figure: Using the onFocus Method

onblur = script

The onBlur event handler executes the denoted JavaScript code or function onto the occurrence of blur event. This is while a window, frame or form element loses focus. It can be caused through the user clicking outside of the current window, frame or form element, using the TAB key to cycle through the several elements on screen, or by a call to the window.blur method.

The onBlur event handler employee the Event objects properties. type - this property denote the type of event. target - this property denote the object to which the event was sent originally.

The following instance illustrate the use of the onBlur event handler to ask the user to check that the details given are correct. Note the first line is HTML code.

<HTML>

<HEAD>

</HEAD>

<BODY>

<FORM NAME = "myform" >

Enter email address <INPUT TYPE="text" VALUE="" NAME="userEmail" onBlur=addCheck( )>

</BODY>

<SCRIPT LANGUAGE="JAVASCRIPT">

function addCheck() {

alert("Please check your email are correct before submitting")

}

</SCRIPT>

</HTML>


Related Discussions:- Onfocus and onblur

Insert images in site, You will study two ways to add images in Dreamweaver...

You will study two ways to add images in Dreamweaver by using Dreamweaver's main menu and by using the Objects panel. 1. Click anywhere within the logo layout cell (the topmost

I want a wordpress specialist, Wordpress specialist 1) Wordpress install...

Wordpress specialist 1) Wordpress install and needed plugins 2) Wordpress theme 3) Wordpress crowd funding plugin or custom made (please specify) 4) Custom details 5

Label, , an HTML 4.0 element supported through MSIE & Netscape 6, describe ...

, an HTML 4.0 element supported through MSIE & Netscape 6, describe a set of text that is linked with a specific form element. For instance, the code below specifies t

We need help in casino site - bitcoin payment, We need help in Casino site ...

We need help in Casino site - Bitcoin payment Need a ready solution to launch a casino site which accepts crypto currencies. I want it urgently and would be interested in hearin

I want help in php, PHP, Wordpress Developer - with Mixpanel I am alteri...

PHP, Wordpress Developer - with Mixpanel I am altering from utilizing Aweber for email management to Mixpanel. I need you to develop a Wordpress plugin that will permit me to

I need experienced developer to build an audio recorder, HTML 5 Audio Recor...

HTML 5 Audio Recorder (Hourly or Escrow) I am seeking a talented fully experienced developer to build an audio recorder in HTML5 (WebRTC style). The audio recorder must work in

Professional expert web engineer wanted for start-up, Professional expert w...

Professional expert web engineer wanted for exciting start-up We are changing the method the world publishes, promotes and consumes video. We are in search of a talented free

Html select element, Use the HTML select element (which must be assigne...

Use the HTML select element (which must be assigned a name since it belongs to the form).  Then acquire its input appropriately on the server-side just like you do for text f

I need help to make hotel booking site, I need help to make Hotel Booking S...

I need help to make Hotel Booking Site - GDS Integration We are building a hotel booking site through GDS integration. We wish to grow very quickly to test concept as well as op

I need speedometer and tachometer, We need to get working Speedometer and T...

We need to get working Speedometer and Tachometer for a car in latest Cryengine Sandbox. You will find how to make it using existing features of Sandbox, or make your own. Ca

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd