Jump to content

Search the Community

Showing results for tags 'validate'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 4 results

  1. I'm making a simple contact form which works and I would like to have the user add in either their phone number OR their email. Both are fine, but at least one is required. I don't want to require both. Anyway, I created an if statement in my php code which works but when I have it return to the form, of course the form has been cleared of the user input. I then decided to create a javascript statement that does the same thing, but it clears the form as well. I personally hate it when that happens to me, so I want to make sure that whoever is filling out the form doesn't lose their information if they forget to input their phone number or email. I'm just learning to code, so I'm not sure what I should do to fix this problem. Is there some sort of HTML code I could use so that one of the two is required before the user hits the submit button? As I said before, I don't want to use the required function for either input. I appreciate any response! 😊
  2. Hi all, I have a problem for sanitizing / validating a web address input. My personal favor is doing it with regex. I made a simple example with preg_replace <?php if (!empty($_POST['wbddrss']) ) { $wbddrss = $_POST['wbddrss']; $wbddrss = trim($wbddrss); var_dump($wbddrss); $validate = preg_replace('/<>/' , '', $wbddrss); var_dump($validate); } ?> But I would like to replace all chars that do not meet what is allowed. I guess the best solution would be to replace everything with a caret to negate. But it seems I cant find the right delimiters. This is the range of characters I would like to allow: A-Za-z0-9+&@#/%?=~_|!:,.;\(\) how is this done in a preg_replace function?
  3. First of all, i am particularly focusing on the cross-reference across files feature. What is it? Simply say, it is like writing Java in Eclipse or Netbeans: When we "dot" a class, a pull down list of member variables show up. When we "ctrl + click" on a usage (of a variable, of a class, of a method, etc), it jumps to the definition of it. I particularly see this feature very helpful, especially when our project goes huge. If we don't need the benefits from this feature, why not use the free and quick editor - Notepad++ ? Many PHP dev tools are equipped with the reference feature. But not many of them can do it across different files. (means in case the definition occurs in a different file of usage.) While I was finding such a (free) IDE which can do this, I heard people keep saying the Eclipse PDT cannot reference across files. Until today, I give it a try. And surprisingly, Eclipse can do it! With the following code snippets: Car.php <?phpclass Car { public function get_type() { return $this->type; // reference OK } public $type = 'ferrari';}class Engine { public function running_in() { // in same file $car = new Car(); // of course this can ref Car echo $car->get_type(); // of course this ok too return $car->type; // of course this ok as well }}?> Driver.php <?php//include 'Car.php'; // works even without include$car = new Car(); // reference OKecho $car->get_type(); // reference OKecho $car->type; // reference OK?> Although this is a good news. Yet I still want to know why people says Eclipse PDT cannot reference across files? Is there any misunderstandings, that I am implementing it wrongly? Also, as many people say, Eclipse is slow because it is Java based. I am ok with the speed. But I still want a comparison list of features of different Web Dev IDE. Thanks for any input about Web Dev Tool discussion! P.S. In addition, JavaScipt list of methods with browser supporting versions (like what Aptana has) would be a very nice feature too!
  4. I was looking through some ways to validate email. I saw the one on w3schools, but that is a basic one, so I started to code something more complicated adding all those if, else if, else statements, etc. Then I came across this... function validateEmail(email){var allowed=/^([a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$)/; return allowed.test(email);} Is something that simple sufficient enough? Everything seems to look as if it would work. Also, what does the "$" do?
×
×
  • Create New...