Write client-side javascript function to convert ampersands

Assignment Help Programming Languages
Reference no: EM1361620

Your job is to write a client-side JavaScript function that converts all ampersands in a form field to the text string " and " when the form loses focus on the textbox in question.

Your HTML form can basically contain one text field with the "id=myText" and the onblur event to call your JavaScript function

Create a JavaScript function named "conertit()" which will:
Store the string from the myText textbox into a variable name "myString"

Use a for loop to loop from zero to "i < myString.length"

Inside the loop, use an "if/else" statement to determine if the current character is equal to an "&" or not. You can use the "charAt(i)" string method to accomplish this.

If it is an "&" then concatenate the new text " and" to a variable named "newString", else, concatenate the current character from charAt(i) to the variable "newString".

Once the loop is over you will then assign "newString" back to the value of the "myText" textbox in the HTML form effectively replacing the content with the newly converted information

Reference no: EM1361620

Questions Cloud

Finance based decision making question : Benson Corporation is evaluating option uses for a three-story manufacturing and warehousing building that it has bought for $225,000.
Show long-term business objectives : Estimate the sustainability of long-term business operations and describe how the global market affects business strategy.
Sustainability and environmental issues : Explain how these decisions enable the organization to avoid violations in terms of environmental issues.
Telephonic or disease management programs : Do you consider telephonic or disease management programs that assign nursing personnel a patient population to serve, useful? Under which circumstances do you think these programs would be useful?
Write client-side javascript function to convert ampersands : Your job is to write a client-side JavaScript function that converts all ampersands in a form field to the text string " and " when the form loses focus on the textbox in question.
Show public employees liability for constitutional torts : Hypothesize a situation in which a public administrator or employee should have the constitutional right to disobey a directive ordered by a superior.
Strengths=weaknesses in japanese management-health care : I need help discussing three strengths and three weaknesses in Japanese management, as it would pertain to health care.
Business self-regulation : Should the issue be resolved through legislative action, global treaties, executive agency regulation or business self-regulation? Why?
Find entropy change of the horseshoe-plus-water system : If so how fast will the cars be traveling when they collided? If they did not, what is a distance between the cars at this point.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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