Em Andamento

JavaScript - Modify ValidateNumber and Currency functions

Hi,

I need a JavaScript guru to modify ValidateNumber and ValidateCurrency functions I am using on a webpage. Right now when a user fillls out a form and clicks on Submit, JavaScript validates the fields entered making sure that some fields are numbers only or in currency format only.? The two functions are listed below.

function ValidateNumber(obj) {

var digits="1234567890";

? for(var i=0;i < [url removed, login to view];i++) {

? ? if([url removed, login to view]([url removed, login to view](i))==-1) {

? ? ? return false;

? ? }

? }

? return true;

}

function ValidateCurrency(obj) {

? ? ? ? var re = /^[0-9]*(\.[0-9][0-9])?$/;? ? ?

? return ([url removed, login to view]([url removed, login to view]));? ? ?

}

The problem? is as follows.? If a user enters 12,000 instead of 12000 the function? ValidateNumber does not allow it (as it only allows numbers) The user gets frustrated and abandons the signup process. I need a coder who can modify? ValidateNumber function to accept the comma (,) if they choose to use it to separate 1000-s like 12000 and 12,000 or 36500 and 36,5000 - Either format should be allowed.

The same problem with? ValidateCurrency function - it does not allow comma after every 1000-s of each number e.g. 1200.50 is allowed but 1,200.50 is not (but it should be) I need this function to be modified as well.

For your information, I use the two function in javascript code as follows.

function Validate(frm)? {

? strError = "";

? ? if (!ValidateCurrency([url removed, login to view])) {

? ? ? AddToErrorList("Monthly Payment must be in currency format");

? ? }

? ? if (!ValidateNumber([url removed, login to view])) {

? ? ? AddToErrorList("Total Miles Allowed must be numeric");

? ? }? ? ?

}

function AddToErrorList(strMsg) {

? if (strError == "") {

? ? strError = "\nPlease fill out the following fields\n";

? }

? strError = strError + "- " + strMsg + "\n";

}

## Deliverables

Need this done asap

Habilidades: Engenharia, Javascript, MySQL, PHP, Gestão de projetos, Arquitetura de software, Teste de Software, Hospedagem Web, Gestão de Site , Teste de Website

Ver mais: javascript validatenumber, test guru, test a javascript, number guru, information guru, guru test, guru javascript, obj c, obj, need javascript coder, monthly payment problem, currency javascript, javascript monthly, modify javascript code, obj format, problem payment process, need 5000 clicks, php code currency, javascript problem, monthly payment using, javascript webpage, code monthly payment, using miles, webpage javascript, need javascript done

Acerca do Empregador:
( 65 comentários ) Canada

ID do Projeto: #3047977

Premiar a:

mightycoder

See private message.

$7 USD em 3 dias
(5 Avaliações)
3.0

5 freelancers estão ofertando em média $7 para este trabalho

DrAKkareS

See private message.

$7.65 USD in 3 dias
(142 Comentários)
5.4
vnoutsourcingvw

See private message.

$8.5 USD in 3 dias
(44 Comentários)
4.7
juliomenendezvw

See private message.

$8.5 USD in 3 dias
(23 Comentários)
3.6
ravikumarsv

See private message.

$5.1 USD in 3 dias
(1 Comentário)
0.5