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
Frosty427
@Frosty427
@sjames1958gm how do i do that?
Stephen James
@sjames1958gm
You can always use git for a repository
THis is at the top of the javascript gitter - not sure why not here. If you are posting code that is large use Gist - https://gist.github.com/ paste the link here.
Bin Gao
@gaobin1019
@Frosty427 or you can use something like codepen
Stephen James
@sjames1958gm
@Frosty427 Why do you have so many forms? Only the first one seems to have an "action" property
Frosty427
@Frosty427
image.png
image.png
image.png
wait
sorry
i had lag
@sjames1958gm im trying to recreate the picture in that screenshot
Stephen James
@sjames1958gm
@Frosty427 For the submit button to work, you need all of this in one form, and I can only see required for first/last name
Frosty427
@Frosty427
but if i do that it wont look like the picture
image.png
Stephen James
@sjames1958gm
How it looks and the form tag shouldn't be related, use CSS to format
Frosty427
@Frosty427
im going off of a course with specific instructions and it says to recreate in html
Stephen James
@sjames1958gm
@Frosty427 without any CSS? That seems unreasonable
if you look at the code i made an input button and tied it to an id but its still not going through
Abdus Samad
@asamad123
so far i have this https://codepen.io/abdus123/pen/WMMYQL?editors=1111 how would i make the user make their own user name and password.
Stephen James
@sjames1958gm
@Frosty427 There is only one form with that id
@asamad123 You would probably implement authentication on the backend not the front
rdollent
@rdollent
@asamad123 back-end. see passportjs authentication
John
@flyboy1565
I need some help.. i have an array [{'orderid':4, 'type':'sale'}, {'orderid':5, 'type':'refund'}]... I want to be able to get see if an order exists in the array that matches a type
rdollent
@rdollent
an order exists?
ah like an order order i thought it was JS terminology
okay so it is an array but each order is an object
John
@flyboy1565
sorry if an orderid exists in the array
rdollent
@rdollent
so you can either do a for loop
which goes through the array i.e. for(var i = 0; i <= yourArray.length;i ++)
and to be able to get the type, you just go
i.type = "something"
since that i pertains to the elements in the array i.e. {orderid:4, type:sale}
John
@flyboy1565
function remove_notification(remove_type){
    $('#alerts .alert').each(function(){
        var oid = parseInt($(this).data('order'));
        var type = $(this).data('type');
        if (($.inArray(oid, notifications) == -1) && (type == remove_type)){
            $('.alert[data-order="' + oid +'"][data-type="'+type+'"]' ).remove();
        }
    })
}
this is what i have so far
rdollent
@rdollent
or or or you can do a .filter
array.filter(function(obj) {
obj.type = "this type";
});
array.filter(function(obj) { obj.type = "this type"; });
array.filter(function(obj) {
  obj.type = "this type";
});
that will spit out an array
that you've to store in a variable
var array = [{'orderid':4, 'type':'sale'}, {'orderid':5, 'type':'refund'}];
var result = array.filter(function(obj) {
  return obj.type === "refund";
});
result;

:
{orderid: 5, type: "refund"}
John
@flyboy1565
what would happen an orderid doesn't exist in there?
what would the ouptut be?
rdollent
@rdollent
var array = [{'orderid':4, 'type':'sale'}, {'orderid':5, 'type':'refund'}];
var result = array.filter(function(obj) {
  return obj.type === "refund";
});
result[0];
{orderid: 5, type: "refund"}
you can put that in the google chrome console
it will say undefined
var array = [{'orderid':4, 'type':'sale'}, {'orderid':5, 'type':'refund'}];
var result = array.filter(function(obj) {
  return obj.type === "xxxx";
});
result[0];

undefined
John
@flyboy1565
perfect thanks for the help @rdollent