Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

loop trough all checkboxes then return true or false

I'm trying to check 2 functions in an if condition.

like this

if (checkTextboxes(sender) && checkRadiobuttons(sender))
{
//here comes the code if true
}
My problem is when i have 1 of the 3 texboxes filled in the condition is True but i want to check all the textboxes first before i get a return, i just can't figure it out..
So basically this:
PHP Code

<?php 
if(new TextBox[] { textBox1, <all other textboxes) }.All(CheckTextBox) && new RadioButton[] { radioButton1, <all other radiobuttons> }.All(CheckRadioButton)) {

} 
[Image: IQE6i8G.png]

BlackCap Wrote:You're even more verbose than Java.
About using GoTo's in VB/C#:
Only3 Wrote:asm use it why u shouldnt
(Sep 13, 2015 06:31 AM)Yui Asuna Wrote:  Yeah, me neither. I can't figure out what in fuck's you are trying to say ?

I'm trying to say that if i go through my first function, it will check 3 textboxes. (1 by 1)

if 1 textbox returns true (not empty) it will continue to the radiobutton function.

If i fill in 1 textbox and checked a radiobutton, it will continue to the code.
And then it will continue checking the other texboxes who are returning false.
But the output is already shown, and that may not be happening
(Sep 13, 2015 06:44 AM)Temploit Wrote:  So basically this:
PHP Code

<?php 
if(new TextBox[] { textBox1, <all other textboxes) }.All(CheckTextBox) && new RadioButton[] { radioButton1, <all other radiobuttons> }.All(CheckRadioButton)) {

} 

Praise the holy LINQ and it's unreadable things
I'll get to learning it someday.
(Sep 13, 2015 06:48 AM)Bald Cat Wrote:  The only thing I got out of this thread is that c# is sorta like java.

if you learn something new each day then you are winning!

OP do you want to get a set true/false from sets? (text1 and Radio1 then text2 and radio2 return different results)

but output all the results at the same time?

[Image: 2f4032b5f1170bc8fedd7e367c680327.png]

(Sep 13, 2015 06:50 AM)Alison Wonderland Wrote:  if you learn something new each day then you are winning!

OP do you want to get a set true/false from sets? (text1 and Radio1 then text2 and radio2 return different results)

but output all the results at the same time?

The output MUST only show when all the textboxes returns True and if there is a checkbox checked.

But when i check a radiobutton and fill in 1 textbox i'm getting the output already.

Because they both return true, that's why i want to check every textbox before returning true or false.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by SIM-4791248Aug 17, 2021 08:06 AM 2 110 Aug 17, 2021 08:06 AM
Last Post: SIM-4791248
[C#] by Stenly21Feb 5, 2018 05:57 PM 11 277 Feb 5, 2018 05:57 PM
Last Post: 0xDEAD10CC
[Java] by ohxerxeFeb 4, 2018 03:26 PM 3 306 Feb 4, 2018 03:26 PM
Last Post: matt