/    Sign up×
Community /Pin to ProfileBookmark

Form input disappearing

Finally cracked the code for my form.

well almost!

If anyone can tell me why the phone number in the input field is disappearing even when it validates and the red highlight disappears.

It doesn’t happen with family name or email.

[ATTACH]8908[/ATTACH]

to post a comment
JavaScript

8 Comments(s)

Copy linkTweet thisAlerts:
@paulamcclauthorMay 15.2007 — sorry attachment didn't work.[ATTACH]8909[/ATTACH] here it is

[upl-file uuid=430273e1-cb49-4763-ad8a-21a9169b187d size=3kB]form1.zip[/upl-file]
Copy linkTweet thisAlerts:
@rootMay 15.2007 — Re Phone, the else must be firing because the regEx is failing, you may want to test to see if the input only contains numbers, you need to remove any spaces and formatting thats present, then test to see if the input is numerical then test it, then process it.

Sorry but I really have to go, this appointment has taken months to get and Jnr misses this appt then its back to sq 1. I can see that you have changed your code a bit I would say its lots easier to read now.
Copy linkTweet thisAlerts:
@paulamcclauthorMay 15.2007 — The regEx can't be failing because when the input is right the red highlighting disappears! The regEx only calls for digits or a space so would validate wrong for any other character.

It must be something else?
Copy linkTweet thisAlerts:
@paulamcclauthorMay 15.2007 — I have checked the regEx and tried others. They all do the same thing.

The field validates, the highlighting disappears, as it should if the regEx returns true. BUT so does the input in the box.

I AM REALLY DESPERATE NOW! I AM RUNNING OUT OF TIME!!!!!!


Can somebody please tell me why the phone number disappears when it valides?
Copy linkTweet thisAlerts:
@rootMay 15.2007 — Just PM'd you with a script I had lurking in a dark corner of my Harddisk, I know it works because I just tested it so all you need to do is quickly look at all the regular expressions to see that as I said, it appears to be your Regular Expressions.
Copy linkTweet thisAlerts:
@paulamcclauthorMay 15.2007 — did you test it with my form, because I can't work out how to integrate it.

I cant say Return anywhere before the end or it messes the whole thing up.

It has to be part of the same function.

I am so sure my form is validating OK with the regular expression. It is such a simple one. When the number is right the error highlight doesnt show, when its wrong it does. when all the fields are right it posts, which it is set up to do if all the fields concerned validate true.

but where do the numbers go??? why don't the other two fields dissappear.

I have less than a day left and Ive not even started writing the report.

My cookies won't display and I'm about ready to quit. I'm off for a hot shower and some paracetemol. I can see this being a very late night.
Copy linkTweet thisAlerts:
@rootMay 15.2007 — Well I tried your form and it appeard to work, the image shows the submit result.

[upl-file uuid=07f5d733-40f0-43ac-9fd9-74f9ca9e358b size=43kB]submit.jpg[/upl-file]
Copy linkTweet thisAlerts:
@rootMay 15.2007 — Hmmm.

Seems that it will accepr any old junk.

NaN may help, Not a Number, eg, if its text it returns true, if its a number it returns false, so !NaN, removing any formatting that the user inputs is also a good idea and then you can test and format as you require.
×

Success!

Help @paulamccl spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...