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

Explain how syntax errors occur in php, Question: (a) With the help of...

Question: (a) With the help of a diagram, illustrate how Three-Tier Web application architecture operates. (b) Explain how syntax errors occur in PHP. (c) Exceptions ar

We want a magento installation and optimization, We want a Magento installa...

We want a Magento installation and optimization We want to have our Magento store installed on a server as well as we need some work done in terms of speed optimization / cachin

Need help in shopperpress customization, Shopperpress Customization I ne...

Shopperpress Customization I need somebody who can commit to work with me starting immediately. The site is built however there are a few customizations needed. Like the menu

Brute Force, How to search the keyword in dictionary and suggest words when...

How to search the keyword in dictionary and suggest words when there is partial match of 3 characters during user input?

I want help in custom php work, I want help in Custom PHP Work I have a ...

I want help in Custom PHP Work I have a website in wordpress and woocommerce with a custom php designing module created not complete. Can share details to the right person. W

Medical data mining, diffierence between ID3 and naive bayes alogrthim

diffierence between ID3 and naive bayes alogrthim

Internet connection, Before we can employ the Internet, we need to gain acc...

Before we can employ the Internet, we need to gain access to it.  This access is attained in one of many ways, which will be discussed in this section. Above all, the Internet is c

I need help to make drupal website for rent apartments, I have a website I ...

I have a website I build it with Drupal for Rent apartments and I have five buildings in different places and every building have different capacity of apartments and different apa

I am in need of wordpress tweaks to existing custom plugins, I am in need o...

I am in need of Wordpress Tweaks to Existing Custom Plugins Was hoping you had some obtainable time today, about hours to work on tweaks to plugin functionally of existing Wordp

Explain the purpose of a wsdl document, Question: (a) Give three typic...

Question: (a) Give three typical uses of Web Services. (b) Explain any five attributes used by Regular Expression Pattern in a WSDL document. (c) Explain the purpose o

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