Dhtml's Posts
Nairaland Forum › Dhtml's Profile › Dhtml's Posts
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 (of 16 pages)
So lets move on with the class, go on iyenimofe. . . |
You boys are jokers, in fact the thread title sef get as e be. |
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). |
@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. |
And here is the screenshot https://a.fsdn.com/con/app/proj/phpbrowserbox/screenshots/screenshot.jpg |
Me don tire small to dey write javascript o. Let us have another volunteer |
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. |
[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. |
You are welcome. Mister Spambot is the oga at the top. |
Yes i did, i am a software programmer as well as a web application developer. . . |
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 |
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? |
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. |
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. |
^^^Your own corrected and working code with explanations - and it must work crossplatform |
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 |
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.Fantastic! |
I no vex nao, my own style of coding is old-skul, http://pastebin.com/DwqsKNYb |
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. |
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...thanksMy 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. |
@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 |
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)?I lack a suitable reply for this post. But it shows lack of understanding to be honest. I will leave it at that. |
[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. |
This is going to be hot! Never Back Down!! |
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. . . |
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. |
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"/> 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. . . |
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. |
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 |
Maybe you hacked into another person's account. . . |
maybe na maintenance tinz |
^^^Maybe you should try that. I can write you a validated code from the scratch, but it is pointless because them get plentiful online. |