₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,331,208 members, 8,449,154 topics. Date: Tuesday, 21 July 2026 at 11:32 AM

Toggle theme

Dhtml's Posts

Nairaland ForumDhtml's ProfileDhtml's Posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 (of 16 pages)

WebmastersRe: Learn Web Design LIVE On Nairaland!!! by dhtml(m):
So lets move on with the class, go on iyenimofe. . .
WebmastersRe: Post your PHP Problems Here by dhtml(m): 3:06am On Oct 03, 2013
You boys are jokers, in fact the thread title sef get as e be.
WebmastersRe: Hlp With Javascript Snippet To Validate A User's Cell Phone Number Input by dhtml(m): 3:03am On Oct 03, 2013
This thread is already completed - since i have solved the thread topic. If you want to learn form validation, you may need to create another thread entirely. But i will advise you to use jQuery form validation - just search google for jquery form validation.
All these codes already exist online, for me to start applying them for you is like spoon-feeding you, and that will not help you. Because in your career as a web-developer, validating form should be the least of your problems. After validating the form in the browser, hope you know you will still validate them in your backend server - php or whatever - because some people may turn javascript off, or bypass the validation using many techniques (curl etc).
WebmastersRe: Hlp With Javascript Snippet To Validate A User's Cell Phone Number Input by dhtml(m): 2:58am On Oct 03, 2013
@op, i think the problem is that you need to learn javascript and increase your html knowlege especially in the area of forms. Normally, i only like writing codes to assist, but to start writing like an entire project is stressful for me. Even that code i wrote sef, i sure say you know understand how to manipulate am at all.
Form validation codes full internet like anything, but to use them, you need to improve on your knowlege of HTML, form element names, IDs and some basic javascript usage.
In case you do not realize it, javascript is far more complex and tougher than PHP, this is the reason why many people (even some good web developers) run away from writing javascript codes. Most people rely on jQuery and other libraries except those that have been javascript gurus before these them jQuery libraries exist.
I love keeping my application size small, so i only use all them libraries when absolutely needed - i dont feature them in over 70% of my projects.
WebmastersRe: Phpbrowserbox - Standalone Windows Browser That Displays Output From PHP 5.4.16 by dhtml(op): 2:46am On Oct 03, 2013
WebmastersRe: Hlp With Javascript Snippet To Validate A User's Cell Phone Number Input by dhtml(m): 6:26pm On Oct 02, 2013
Me don tire small to dey write javascript o. Let us have another volunteer
Christianity EtcRe: Pastor Shot To Death While Preaching During Service by dhtml(m): 6:23pm On Oct 02, 2013
Tunjasko: When the preaching was abt going to an END,at a TIME when the pastor was in spirit,sme bad TINZ happen and the pastor was shot dead...very painful..*sobs*
Lai! La! this na the real meaning of END TIME TINZ - Just in case you dont know it yet.
WebmastersRe: Hlp With Javascript Snippet To Validate A User's Cell Phone Number Input by dhtml(m): 2:14am On Oct 02, 2013
[quote author=CODE-EATER]Dhtml...u sabi nodejs?


Need some briefing tuts on it[/quote]Yes I Sabin node, express and phone gap, but those things are hard to teach small, I don resign from writing tutorials these days, no time.

Putting a whole form together and validating is not so easy, my advise is to post the link to the form online and let people validate and contribute.
WebmastersRe: Hlp With Javascript Snippet To Validate A User's Cell Phone Number Input by dhtml(m): 10:41pm On Oct 01, 2013
You are welcome. Mister Spambot is the oga at the top.
WebmastersRe: Phpbrowserbox - Standalone Windows Browser That Displays Output From PHP 5.4.16 by dhtml(op): 10:41pm On Oct 01, 2013
Yes i did, i am a software programmer as well as a web application developer. . .
WebmastersPhpbrowserbox - Standalone Windows Browser That Displays Output From PHP 5.4.16 by dhtml(op): 5:55pm On Oct 01, 2013
This is a standalone windows browser that displays output from PHP 5.4.16, also supports SQLite3.

How it works:
It does not need an installation, you just run it directly from a pc, you can even run from your flashdrive. And it does not conflict with regular servers like wamp or other apache server.

Once the browser loads, it starts its internal php server and displays the default index.php almost immediately.

https://sourceforge.net/projects/phpbrowserbox
WebmastersRe: Hlp With Javascript Snippet To Validate A User's Cell Phone Number Input by dhtml(m): 5:46pm On Oct 01, 2013
That does not make sense to me, the smart thing to do is to prevent rubbish from being entered.
So if user enters 17 characters, it pops up message to reduce? why not prevent from getting beyond what you want?
WebmastersRe: Hlp With Javascript Snippet To Validate A User's Cell Phone Number Input by dhtml(m): 5:18pm On Oct 01, 2013
I used ordinary html4, no html5.
change the submit code
replace <form action="javascript:alert('Please put script to submit to');">
with
<form action="submit.php">
that is what is popping up when u are trying to submit.

i told you how to limit the maximum length in an earlier code - maxlength attribute in the button form.
WebmastersRe: Hlp With Javascript Snippet To Validate A User's Cell Phone Number Input by dhtml(m): 3:12am On Oct 01, 2013
Which browser did you test it inside? This is an online link of what i gave you - http://.net/demos/phone.html - and it does not accept numbers.
Maybe you should upload the script you wrote online so we can see it - i cannot help you debug what i cant see - my code is working well no doubt.
But i must warn you that if you make a single mistake inside javascript, the code will fail - even if the mistake is from another script. So let us have a public link so we can see the problem.
WebmastersRe: Hlp With Javascript Snippet To Validate A User's Cell Phone Number Input by dhtml(m): 8:36pm On Sep 30, 2013
^^^Your own corrected and working code with explanations - and it must work crossplatform
Jobs/VacanciesRe: People With Flat-Foot Cant Be In The Military: Why? by dhtml(m): 8:34pm On Sep 30, 2013
But lets look at this:
However, three military studies on asymptomatic adults (see section below), suggest that persons with asymptomatic flat feet are at least as tolerant of foot stress as the population with various grades of arch. Asymptomatic flat feet are no longer a service disqualification in the U.S. military.
http://en.wikipedia.org/wiki/Flat_feet
Jobs/VacanciesRe: People With Flat-Foot Cant Be In The Military: Why? by dhtml(m): 8:32pm On Sep 30, 2013
johnemeka: The simple answer is that there is a vein that passes through that curved area and the millitary boot is desinged with that curve.If you have straigth footh,the curve in the boot will constrict or block that vein and make it defficult for blood circulation.when one is on parrade the heart tends to pump faster to push More blood for metarbonism to take place for energy release to carry out action.
Anyone with flat foot will not survilve millitary because once he stays long standing or on parrade with the boot he will feel dizziness and will faint.
During my NYSC service I learnt about this from the Nigerian Red Cross society.this is why any time someone faints, you are adviced to remove the foot wear,belt,cap,loosen up the cloth.
Enjoy!!!
Fantastic!
WebmastersRe: Hlp With Javascript Snippet To Validate A User's Cell Phone Number Input by dhtml(m): 8:26pm On Sep 30, 2013
I no vex nao, my own style of coding is old-skul,
http://pastebin.com/DwqsKNYb
WebmastersRe: Hlp With Javascript Snippet To Validate A User's Cell Phone Number Input by dhtml(m): 4:21pm On Sep 30, 2013
If you want to add a button, you can add submit button, but my script does not need button to validate. The only thing is that you may be looking at form validation to prevent empty phone number field from getting submitted. But my code makes sure you only enter valid phone number. If you want to prevent someone from using Ctrl + v to paste, I can show u how to block that.

By the way, I use unobtrusive style of coding.
WebmastersRe: Hlp With Javascript Snippet To Validate A User's Cell Phone Number Input by dhtml(m): 4:13pm On Sep 30, 2013
wisemania: boss,ibeg dat ur code no complete atall,u for no sleep typ naw,anywaz i try am again..u didnt add a prompt 2 b displayed if d user inputs a right or wrong number,a button 2 activate d script,...plsssss restructure d code again,i mst understand diz tin 2dae,by fire by water...thanks
My code does not need a button, and it is complete. My code makes sure only numbers are entered into the phone field, of you try entering rubbish, it will not accept it, plain and simple. The script watches your keyboard as you are typing. You never see this kind code before?
And oncontextmenu has been since html4, but most developers except maybe oldies like me know it and use it.
HealthRe: Nation Wide Strike By Resident Doctors From 1st October by dhtml(m): 7:05am On Sep 30, 2013
@KDULAR, Either you are an ignorant person or you do not know what resident doctors actually do (or you are one of those badbelle health workers that is competing with doctors who are the leaders of the health-team whether you like it or not). Do you think teaching hospitals can run without resident doctors.
Aside training, do you realize that resident doctors virtually run all the THs and carry out most of the surgeries and all that?

#


END TIME TINZ
HealthRe: Nation Wide Strike By Resident Doctors From 1st October by dhtml(m): 6:56am On Sep 30, 2013
firedup: meanwhile,nard -are they not post garduate students? how come they are paid? is it not them that should pay fg school fees for using the hospital and patients as a practising tool(lab animals)?
now why are they complaining when ippis have exposed that they work as residents(pg students) in one Fg hospital and also m.o(medical officer) in another fg hospital and also working inalary private hospitals thereby collecting salary triple which is against the law.
u guys should just leave Gej alone
I lack a suitable reply for this post. But it shows lack of understanding to be honest. I will leave it at that.
WebmastersRe: Hlp With Javascript Snippet To Validate A User's Cell Phone Number Input by dhtml(m): 6:50am On Sep 30, 2013
[quote author=CODE-EATER]lol...lie lie boy...u?...any way no probs..although my approach is a Wii bit simpler and easy to comprehend..

"Keep it simple,stupid"
-tim O'Reilly.

LOADING...[/quote]I am still expecting the final version of your code. Lets compare so the op uses the one he feels more comfortable with.
HealthRe: Nation Wide Strike By Resident Doctors From 1st October by dhtml(m): 1:40am On Sep 30, 2013
This is going to be hot! Never Back Down!!
WebmastersRe: Hlp With Javascript Snippet To Validate A User's Cell Phone Number Input by dhtml(m): 1:38am On Sep 30, 2013
Are you sure i have accomplished it? You may want to do your own version, oya, make we hear your explanation. Me no sabi explain at all at all. . . .even me sef no understand my own explaining and explanations. . .
WebmastersRe: Hlp With Javascript Snippet To Validate A User's Cell Phone Number Input by dhtml(m): 12:26am On Sep 30, 2013
Let me try to explain this code a bit more. This is a shorthand code that means
evt = (evt) ? evt : window.event;

if (evt) {evt=evt;} else {evt=window.event;}
it also meants
if (evt=true) {evt=evt;} else {evt=window.event;}

The way events work on microsoft internet explorer and other browsers is slightly different. This code bridges that gap.

But if you are using jQuery and all them them library, you do not need to bother yourself with crossplatform issues.
WebmastersRe: Hlp With Javascript Snippet To Validate A User's Cell Phone Number Input by dhtml(m): 12:22am On Sep 30, 2013
Okay, time to explain,

first i am trying to create a scenario whereby you type in your phone number with just numbers, the script automatically adds the dash to it.

So we start with the html markup:
<input type="text" id="phone" onkeypress="return isPhone(this,event)" oncontextmenu="return false"/>
onkeypress will signal the script when you press a key on the keyboard.
isPhone - is a function which tests if what you type on the keyboard is a number. A simple way of testing that is to check for the keyboard scan codes. 0 will give you 48 and 9 will give you 57.

evt.which : evt.keyCode - will tell us the key that was pressed on the keyboard.

charCode > 31 && (charCode < 48 || charCode > 57) = means that if the key pressed is not enter, backspace, delete and it is not a number
followed immediately by return false; = which means just cancel the key that was pressed so it does not show

if(el.value.length==3||el.value.length==7||el.value.length==13) {el.value=el.value+"-";} - this is the code to add the dashes as you type your number.

oncontextmenu="return false" - this will prevent right click from showing. Notice that i did not disable ctrl+v from pasting - this can be done if requested.

Now, this code is somewhat unobtrusive which means you can use it for more than one textbox on the same page.

This means that you can line up the following on the same page:
<input type="text" id="phone" onkeypress="return isPhone(this,event)" oncontextmenu="return false"/>
<input type="text" id="phone1" onkeypress="return isPhone(this,event)" oncontextmenu="return false"/>
<input type="text" id="phone2" onkeypress="return isPhone(this,event)" oncontextmenu="return false"/>

and there wont be clashes

@op, you may want to add a maxlength to limit the total number of characters that can be typed. Notice that 3 dashes are added.
So if you are looking at a standard gsm number e.g. 07030234535 which will be written as 14 characters
<input type="text" id="phone" onkeypress="return isPhone(this,event)" maxlength="14" oncontextmenu="return false"/>


Now, this code is crossplatform and works well on all browsers (at least i expect it to).

Sleeps off on the thread. . .
WebmastersRe: Hlp With Javascript Snippet To Validate A User's Cell Phone Number Input by dhtml(m):
I tried to do this with as few lines as possible, and as simple as possible:

http://pastebin.com/XjPQdrWW

I am quite sleepy too, so it is possible i have overlooked something.

Oh, i forgot to add the explanations - typical of me to write codes without explanation.
WebmastersRe: Hlp With Javascript Snippet To Validate A User's Cell Phone Number Input by dhtml(m): 11:15pm On Sep 29, 2013
I am now getting annoyed and frustrated, okay, let me code something simple - without using any libraries online,
kai, i got like 20 open windows minus tabs, okay, let me give it a trial - hope i succeed
WebmastersRe: Naijaloaded by dhtml(m): 6:00pm On Sep 29, 2013
Maybe you hacked into another person's account. . .
WebmastersRe: Naijaloaded by dhtml(m): 2:48pm On Sep 29, 2013
maybe na maintenance tinz
WebmastersRe: Hlp With Javascript Snippet To Validate A User's Cell Phone Number Input by dhtml(m): 2:46pm On Sep 29, 2013
^^^Maybe you should try that. I can write you a validated code from the scratch, but it is pointless because them get plentiful online.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 (of 16 pages)