Thanks for the reply.
I'm not actually looking to build gutenberg blocks. I'm trying to understand how from a React perspective how it actually functions.
Sorry for the confusion.
Josh
Josh Connerty 20 Unverified User
Josh Connerty 20 Unverified User
matei_ commented: Thank you very much! You saved me. It works in the way I want it to. +0
Josh Connerty 20 Unverified User
Josh Connerty 20 Unverified User
matei_ commented: Any updates? Can't we work something from cidrToRange function? +0
Josh Connerty 20 Unverified User
Josh Connerty 20 Unverified User
matei_ commented: I solved the error, but the problem is now that I get only the IPs only to .24 and I should get until .255 +0
Josh Connerty 20 Unverified User
matei_ commented: The $pluginData -> ipAddresses is the actual text area that holds all the CIDR ranges. +0
KnowledgeMan commented: Thanks. I kinda understand what you mean. Can you please provide an example or guide on how to do it? +0
KnowledgeMan commented: Thank you it is showing success but the database is not getting updated. I think the issue with state: var state = ($(this).is(':checked')) ? '1' : '0 +0
KnowledgeMan commented: So how do I resolve it? Sorry for asking again I am new to programming +0
KnowledgeMan commented: No sorry my mistake, yeah now it generating array(1) { ["ids"]=> array(1) { [0]=> string(1) "1" } } when I click the first checkbox +0
KnowledgeMan commented: Yes it does return nothing +0
KnowledgeMan commented: Yes so on request I get this value ids[]:[..] 0:"1",1:"2" and for reponse nothing +0
KnowledgeMan commented: Ok, I am getting the message "Click event triggered", status code "200". So the form is getting submit +0
Josh Connerty 20 Unverified User
matei_ commented: Using "var_dump($pluginData -> ipAddresses)" it shows me this: "array(0) { }"... +0
Josh Connerty 20 Unverified User
matei_ commented: Sure, thank you very much! +0
Josh Connerty 20 Unverified User
matei_ commented: I get only the CIDR, e.g.: 88.39.88.0/24, 89.33.88.0/24 etc.. I want to retrieve a list with IPs from all the CIDRs that I have in my textarea. +0
KnowledgeMan commented: Thanks for the relpy. Well I get no errors on the page and nothing in inspector as well. +0
Josh Connerty 20 Unverified User
matei_ commented: "Notice: Undefined variable: cidrs on line 41 && Warning: Invalid argument supplied for" - Line 41" foreach($cidrs as $cidr) +0
Josh Connerty 20 Unverified User
matei_ commented: Your function works as you said, but what I am trying to do is to retrieve a full list with IPs from the CIDR ranges that I have. +0
Josh Connerty 20 Unverified User
Josh Connerty 20 Unverified User