• JavaScript is basically used for the validation purpose, In such a situation it is necessary that user will give correct input to the application. For example correct format of email ID, Correct phone number format, name should not be null, etc.
• Java script is very easy to use and write in the application. In javascript there is only one data type that is VAR.
• In javascript we can display message using ALERT function. So it will display message box with ok button.
Inline JavaScript Example
• In the above example I have created one button, when I click on that button the onclick event will fire, and browser call the p1() function and whatever written
inside the browser will execute it.
External JavaScript Example
• The meaning of the external JavaScript means we just create the new page named TEST.js (must be inside htdocs), place them into the js folder and call it into your php page.
• In the above screen shot I have create one .js file in that I have write some JavaScript function.
• Now what we want is when we run our .php page and click on the button the external JavaScript will be called first and then executes it by the browser.
Call .js file into .php page
The above example shows one HTML page and we will work form validation using JavaScript. Here in below I have specified some screen shot those contain JavaScript code.Here I have specify some of the code for form validation…
break;
}
}
}
When you write this code in your php page it will generate the pop up window
• Java script is very easy to use and write in the application. In javascript there is only one data type that is VAR.
• In javascript we can display message using ALERT function. So it will display message box with ok button.
Inline JavaScript Example
• In the above example I have created one button, when I click on that button the onclick event will fire, and browser call the p1() function and whatever written
inside the browser will execute it.
External JavaScript Example
• The meaning of the external JavaScript means we just create the new page named TEST.js (must be inside htdocs), place them into the js folder and call it into your php page.
• In the above screen shot I have create one .js file in that I have write some JavaScript function.
• Now what we want is when we run our .php page and click on the button the external JavaScript will be called first and then executes it by the browser.
Call .js file into .php page
The above example shows one HTML page and we will work form validation using JavaScript. Here in below I have specified some screen shot those contain JavaScript code.Here I have specify some of the code for form validation…
break;
}
}
}
When you write this code in your php page it will generate the pop up window















No comments:
Post a Comment