Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
kerafyrm02
@kerafyrm02
Why not just use regex functions?
Emil
@aguyinmontreal

it's then used here:

if (markErrorRows($rows, !hideErrors)) {
errors.push("Office Locations" + ": " + "Please fill the fields labelled in red.");
}

Ken Haduch
@khaduch
@kerafyrm02 - the representation of negative numbers in binary, especially something like -1 is 1111111111111 - mostly ones. So if you OR those values together, most of the bits are already set to 1, which likely result in not much of a change in the final numeric value.
kerafyrm02
@kerafyrm02
@Emil I still dont see how that function does form validation.
Emil
@aguyinmontreal
@kerafyrm02 me too :D, it's part of a bigger form validation system
kerafyrm02
@kerafyrm02
there's like 5 types total. so much easier imo to do regex for each one
Not even 5 that need to be validated ., lol.
Emil
@aguyinmontreal
@kerafyrm02 yes, regex is definitely used somewhere :D
kerafyrm02
@kerafyrm02
email / number
are $rows the input fields?
Emil
@aguyinmontreal
yes :D
kerafyrm02
@kerafyrm02
what's the point of add?
doesnt even get used
Emil
@aguyinmontreal
I think it's the system that puts the fields in red when the value is incorrect
kerafyrm02
@kerafyrm02
but i mean the function never uses it
no point of passing it to it
what kind of input field do you use
Emil
@aguyinmontreal
yes in markErrorRow
function markErrorRow($row, add) { var $cols = $row.find('.col:not(.optional)'); var filled = rowFilled($row); var added = false; $cols.each(function () { var $self = $(this); if (!getValue($self) && filled === -1) { if (add) { added = true; $self.addClass('empty_error'); } } else { $self.removeClass('empty_error'); } }); return added; }
markErrorRow and markErrorRows are not the same
kerafyrm02
@kerafyrm02
Can you do this in your console on your page that has the form?
var inputs = $("input");
$.each(inputs, function(_, e){

console.log(e.type);

});
kerafyrm02
@kerafyrm02
So custom made validation..
creator0323
@Amasian
Wh I insert some images, I use URL which is sometimes very long usually because I copy the URL from free icon web site. But I noticed that some people using image for their web development, They only use simple src such as '~.png'. How can i user simple and short src like them?
kerafyrm02
@kerafyrm02
depends on which icons you use
it's better to save the images to your server. place them all in one folder
ie
<img src="/images/down_arrow.png" alt="down_arrow">
or
creator0323
@Amasian
Do I need to install my private server for that?
kerafyrm02
@kerafyrm02
Well.. to display your website you need one-- just use same one
place the folder on the public side though
it's usually called public_html
but only place images in it
/public_html/images
or
<div style="background:url('/images/downarrow') no-repeat center center;"></div>
creator0323
@Amasian
so the public html will be site personal web server and I can store my images on it?
is it related to concept called FTP?
kerafyrm02
@kerafyrm02
In order to display your website to the public you need a webserver. You can create one or you can buy one. It's far easier to just buy one. Once you buy one it will have various folders., one of which is likely called "public_html". Create a folder called images and then place only your images in it.
FTP allows you to move files from your home computer to a remote server.
File Transfer Protocol.
creator0323
@Amasian
ah then It will be better for me to buy one too
Do you have any recommending company providing personal web server company?
kerafyrm02
@kerafyrm02
Sure one sec.
Ill send you a PM
creator0323
@Amasian
@kerafyrm02 I really appreciate your help! thank you :)
CamperBot
@camperbot
amasian sends brownie points to @kerafyrm02 :sparkles: :thumbsup: :sparkles:
:cookie: 289 | @kerafyrm02 |http://www.freecodecamp.org/kerafyrm02
kerafyrm02
@kerafyrm02
Corey Lewis
@cursiv3
what do you mean by custom js files?