Jump to content

AndyB

Member
  • Posts

    37
  • Joined

  • Last visited

Everything posted by AndyB

  1. Hi Ben, Thanks for your insight, I realised I hadn't added the form with the e-mail address field. Here's the code I reworked: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>E-MAIL INFO</TITLE> </HEAD> <BODY> <script LANGUAGE="JavaScript"> <!-- function showUpper(checked) { var showThis; if (checked) { showThis = document.myForm.name.value.toUpperCase(); } else { showThis = document.myForm.name.value.toLowerCase(); } document.myForm.name.value = showThis; } function emailTest(form) { if (form.email_address.value.indexOf("@", 0) < 0) { alert("This is not a valid e-mail address!"); } else { alert("This could be a valid e-mail address"); } } //--> </SCRIPT> <FORM NAME="myForm"> Name:<BR> <INPUT TYPE="text" SIZE="30" NAME="name"> <INPUT TYPE="checkbox" NAME="upperCheckbox" onClick="showUpper(this.checked);"> Covert string to uppercase or lowercase<BR> Email address:<BR> <INPUT TYPE="text" SIZE="30" NAME="email_address"> <INPUT TYPE="checkbox" onclick="(this.checked) ? emailTest(this.form) : '';"> Test for email address<BR> </FORM> </BODY> </HTML> The first field turns the user's name to upper case The second field forces the user to input the @ sign in the e-mail address. How can I modify the email Test function to ensure that it contains the .com suffix? Also Ben,when I reply to your mails, I click: -'Reply' -start typing after the /quote part of your reply -Click 'Add reply' How can I : -Reply to you without having your last mail attached to my reply?And -Does my reply appear on the forum or are we in a private conversation? Thanks for your help Ben, Regards, Andy.
  2. Hi Ben, I hope you're well and that your work is going OK too. Thanks for your reply to my last CSS query. I went to the "free CSS templates"site as you suggested and downloaded a template that I'm working on at the moment. I've got a code query that I was hoping you might be able to help me with. I'm trying to modify the e-mail Test(Form) in this code snippet but I get nothing displayed at all. I'd be grateful to have your insight on the error I made here. Many thanks Ben, Andy. <HTML> <HEAD> <TITLE>E-mails</TITLE> <script LANGUAGE="JavaScript"> function emailTest(form) { if (form.email_address.value.indexOf("@", 0) < 0) { alert("This is not a valid e-mail address!"); } else { alert("This could be a valid e-mail address"); } } </SCRIPT> </HEAD> </HTML>
  3. Hi Ben, I hope you 're alright and that your work is going fine too. I've been getting into the killer.sites practical section of the JavaScript for Beginners tutorials. I've put to practice some of the code on validating forms and used the GetElementbyId and InnerHTML functions to toggle menus. I'm into the external JavaScript section now and I have a couple of questions I hope you might be able to answer. -Is using external JavaScript files the preferred method of using JavaScript? Stefan mentions that it is almost always done with CSS, so I was wondering if,when using manual JavaScript,it is best to have it written in an external file. My second question is sort of a follow up on my last post. Stefan mentions Scriptaculous and jQuery as external libraries that you can link your pages to, to do form validation and create widgets for JavaScript. When I was asking about "pre-existing CSS background images etc..."I was thinking about CSS libraries but formulated it poorly. I will go and look it up on the Internet,but -Are there any CSS libraries that you could recommend? Thanks in advance for your help Ben, Regards, Andrew.
  4. Hi Ben, I hope you're well and that work is going fine too. I was hoping you might be able to help with this query. I think I have the basic HTML skills more or less in place, whereby I can write basic HTML pages with tags and elements. Ideally, I would like to build a site, perhaps in view of putting together something I can show friends and improve on. I'm learning JavaScript forms at the moment with the Killer Sites tutorials, to add functionality to the site. I realise that my CSS is not very good though. I was wondering if there were resources available on the Net with good CSS templates that you could use to build your own sites. You obviously know that CMS 's use that principle, in Wordpress for example Could you possibly point us towards pre-existing CSS background images, fonts,colour shades? Many thanks Ben, Regards, Andy.
  5. Thanks a lot for taking the time to look at this code Ben, it helped make things clearer and I'm going to brush up on my HTML/CSS too , Regards, Andy.
  6. Hi Ben, Thanks for your reply to my last post and breaking down the differences between JavaScript and PHP to me. I will try to illustrate the kind of little JavaScript bits I try to use to add functionality to my attempts at putting a site together. <HTML> <HEAD> <TITLE>Button</TITLE> <script LANGUAGE="JavaScript"> function myFunction() { alert("The function has been called."); } </SCRIPT> </HEAD> <BODY> <HR> <FORM NAME="myForm"> <INPUT TYPE="button" VALUE="call function" onClick="myFunction();"> </FORM> </BODY> </HTML> I've picked up that bit from a manual explaining how to "write" buttons for a user to click on. My query is(and I apologise in advance for the clumsy formulation)is the button a part of the <FORM> element ? I know I've got a button named"call function" that comes up and when I click it, I get the alert box that says "The function has been called", but I'm not exactly sure which bits of code do what. Thanks in advance for your help with this matter, Regards, Andy.
  7. Hi Ben, Thanks for the tip on the J Query course, I'll look it up as soon as I'm done with the JavaScript course. I've got a question which I might not be able to formulate very well, but I'll try to anyway. If I'm not mistaken,PHP is the language used for Facebook, YouTube and WordPress. You may know someone who needs to update a WordPress site for example. If you're a PHP coder your skills can be used in that context I would imagine. Similarly, if you become fairly competent with the JavaScript skills available in the course, in which context can you use those skills? I seem to understand that JavaScript is useful to write forms for example, which is what I intended to use it for in my own site. I appreciate that my question is probably a bit vague but I would be grateful if you could exemplify the use of JavaScript in Web development. Many thanks Ben, Andrew. PS; Sorry about the reply blunders, I hope I've got it right this time, I used to click the "Add Reply" button at the bottom of the page!
  8. Hi Ben, Thanks for your reply. I've checked the link Would you know if there also is an "Advanced JavaScript" course? Or, is The J Query course the follow up to the JavaScript for beginners course? Cheers Ben, Regards, Andy.
  9. Hi Ben, Thanks for your kind greetings and your very prompt reply. I checked the code and Stefan's video and you were right on the money. The mistake was indeed" 1<10" as opposed to "i<10". Obviously, "i" is the variable and I didn't call it in the "for" loop! Cheers for your insight Ben. Could you possibly confirm if there is a JavaScript forum on the site? Best regards, Andy.
  10. Hi guys, My name is Andy,I've just started learning JavaScript and I'm new to the Killer Sites community. I've got Web developer friends here in Brighton,England where I live and I enjoy tinkering with code a lot. I'd like to learn the ropes to try and make myself useful in that community and start building stuff. I discovered Stefan's videos on YouTube and I think his work is awesome for beginners like me. He recommends joining the community that's been built around his site, so here I am! This is my first post, so I apologise if it's below the community's standards. I have a coding query and I would be grateful for anyone's help with it. In the JavaScript for Beginners video there's a chapter on Loops. Both the "while" loop and the "for" loop are explained with code bits. I use Google Chrome as my browser and I've run code from other videos just fine. Somehow,the "for" loop code is going into what Stefan refers to as the "endless loop." After trying to run the code a couple of times,my browser crashed on me and I had to restart the PC. Anyway,this is the code that I copied from the video tutorial into Notepad this morning: for(var i = 1; 1<10; i++) { document.write(i + "<br> "); } Is the syntax not correct for the Google Chrome browser perhaps? I've actually run the code in IE8 and Firefox and got error messages too. I'd be grateful for anyone's insight on this code error. Thanks a lot everybody, Andy. PS: I'd be happy to receive advice about sorting out my profile data too. I'd like to fall in line with the community's expectations in that respect. Thanks.
×
×
  • Create New...