Search the Community
Showing results for tags 'empty'.
-
Hello, I've just read the tutorial on how to process a form in PHP, available on this site, and I was wondering if there's a specific reason to declare empty variables (or arrays) at the beginning? I don't understand what is the point of doing so. For example, in the following code, why would the 2sd and 3rd lines be necessary? <?php $errors = []; $name = $email = $message = ''; if (condition) { $errors['name'] = 'alert'; } else { $name = sanitize_input($_POST['name']); if (new_condition, $name) { $errors['name'] = 'new alert'; } }
-
Dear all; Is there any technical difference between initially setting a variable to false or setting it to an empty value at the beginning of a script, i.e., $x = false; vs $x='';
-
Hello everyone In the first bullet point of the chapter summary on HTML attributes (bottom of the page) it is stated: "All HTML elements can have attributes". Am I misunderstanding that by thinking empty elements can also have attributes? I tried to verify this by writing: (XHTML) <br title="test"/>or<br title="test"></br> or (standard HTML) <br title="test"> only to watch it not work as per my expectation because no tooltip is shown, however I hover over the document (code author: Mrw3c). Last I checked on the section about HTML elements, it does not s
- 4 replies
-
- html
- attributes
-
(and 1 more)
Tagged with:
-
I'd like to hide the corresponding button when an input value is empty or has a value="n/a". In the following example, the input box "first_field" is corresponding with the button "first_button", and the input box "second_field" with the button "second_button", and so on... In this case the second and fifth button will be hidden: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Hi
-
HEllo i am working on a site, but it is not uploaded so i will only post the code here for help. It is about a big large empty space, almost twice as large as the page were all the design is, maybe it goes out of the container too but i am not sure. So what do i need to do, or to remove in css for it to be ok. I notice that when i remove the "meny"boxes "wich are located to the left) the site becomes fine, but when they are there this empty space is coming up :/. What do i need to do? There are 2 css files. The one named pse5menyset.css is the one with the menys to the left you need to look in
-
The idea:The idea is to automatically fill the fields with "user@mail.com" and "password" if they're left blank. The problem:Well, the Javascript check is working and doing what it is supposed to. However, if the user adds a value, and then erases that value leaving the input empty, the script doesn't detects the field as empty... although the value returned is indeed empty like "". The code: function loginFormToggleFillers(element){ var loginF = document.loginForm.login; var user = loginF.value; var passwordF = document.loginForm.password; var password = passwordF.value; if(element){