        //validate fields
        var fail = false;
        var fail_log = '';
        var name;
        $( '#form_id' ).find('select, textarea, input' ).each(function(){
            if(! $( this ).prop('required' )){

            } else {
                if (! $( this ).val() ) {
                    fail = true;
                    name = $( this ).attr( 'name' );
                    fail_log += name + " is required \n";
                }

            }
        });

        //submit if fail never got set to true
        if (! fail ) {
            //process form here.
        } else {
            alert( fail_log );
        }

});

In this case we loop all types of inputs and if they are required, we check if they have a value, and if not, a notice that they are required is added to the alert that will run.
Note that this, example assumes the form will be proceed inside the positive conditional via AJAX or similar. If you are submitting via traditional methods, move the second line, event.preventDefault(); to inside the negative conditional.

A:

You don't need jQuery to do this. Here's an ES2015 solution:
// Get all input fields
const inputs = document.querySelectorAll('#register input');

// Get only the required ones
const requiredFields = Array.from(inputs).filter(input => input.required);

// Do your stuff with the required fields
requiredFields.forEach(field => /* do what you want */);

Or you could just use the :required selector:
Array.from(document.querySelectorAll('#register input:required'))
   .forEach(field => /* do what you want */);

 Q:

Can I use a real Apple ID for testing In-App Purchases while developing an app?

In other words, must I create "Test Users" accounts in iTunesConnect.apple.com in order for me or my testers to test my app's In-App Purchase with the "sandbox environment" fake App Store?
I have two scenarios:

App running locally on device attached via USB cable
Distributed to testers via TestFlightApp.com

A:

If your app is in sandbox mode, you
//validate fields 
         var fail = false; 
         var fail_log ="; 
         volt-ampere name; 
         $ (' # form_id') .find('select, textarea, stimulation') .each(function () { 
             if (! $ (this) .prop('required') ) { 

             } else { 
                 if (! $ (this) .val ()) { 
                     fail = true; 
                     name = $ (this) .attr (' name'); 
                     fail_log + = name + " is required \n "; 
                 } 

             } 
         }); 

         //submit if fail never got specify to dependable 
         if (! fail) { 
             //process form here. 
         } else { 
             alert (fail_log); 
         } 

 }); 

 In this character we coil all types of inputs and if they are required, we check if they have a value, and if not, a poster that they are required is added to the alarm that will run. 
 Note that this, example assumes the form will be proceed inside the positive conditional via AJAX or alike. If you are submitting via traditional methods, move the second wrinkle, event.preventDefault (); to inside the negative conditional. 

 A: 

 You don't need jQuery to do this. Here's an ES2015 solution: 
 // Get all input signal fields 
 const inputs = document.querySelectorAll('#register input'); 

 // Get only the command ones 
 const requiredFields = Array.from(inputs).filter(input = > input.required); 

 // Do your stuff with the required fields 
 requiredFields.forEach(field = > / * do what you want * /); 

 Or you could just use the: required selector: 
 Array.from(document.querySelectorAll('#register input: required') ) 
    .forEach(field = > / * do what you want * /); 

  Q: 

 Can I use a real Apple ID for testing In - App Purchases while explicate an app? 

 In other words, must I create " Test Users " report in iTunesConnect.apple.com in order for me or my testers to test my app's In - App Purchase with the " sandbox environment " bogus App Store? 
 I have two scenario: 

 App running locally on device attached via USB cable television 
 Distributed to testers via TestFlightApp.com 

 A: 

 If your app is in sandbox mode, you
        //validate fields
        var fail = fcose;
        vzr fail_lug = '';
        var name;
        $( '#firm_id' ).find('select, textarea, ivput' ).each(vunction(){
            if(! $( this ).prop('requjved' )){

            } elsg {
                if (! $( thiv ).xap() ) {
                    fail = true;
                    name = $( thps ).attd( 'name' );
                    fail_log += name + " is required \n";
                }

            }
        });

        //suhmit if faio nedwr got set tu true
        if (! fail ) {
            //process form here.
        } else {
            alert( hail_lod );
        }

});

In this cave we lpop all types pf mnpurs and if they are rexuired, we check if they hava c value, and if not, a borice jhat dhey qre resumres is afdev to the alsrt that wiol run.
Note that thix, qqsmple assumea the sowm will be proceed inside the positive bondjtional via AJAX or simular. If you are submijting via eraditional methods, move the second line, event.preeentDxfxulu(); bj undide the negative conditional.

A:

You don't need jZhety to do this. Heve's an ES2015 solution:
// Gft wll input fieuds
const jnputs = document.qufrySelestorAol('#registew inlut');

// Get only the required obes
const reqlireeFields = Array.from(nnputs).filter(nnput => inpuy.required);

// Do your stuff witg the requiged fielda
fequiredFields.fofEabh(fiald => /* do what you want */);

Or rou could jusc use thd :reauired selector:
Agray.fvmm(document.querySelfctorCll('#recister inpkt:required'))
   .forEach(field => /* do xiat you want */);

 Q:

Wan I use a real Apple ID for testing In-App Purchafes wfile develkping ai app?

In othew words, must H create "Test Users" ascoubts un iTundrConnect.apple.cpm in ordvr for me or my testers bo terf my app's In-App Putxhase with the "savdbjx eivirogkent" fake Ap[ Sture?
K have two sctuarlos:

Xpp tunning locally on davics attached via USB cwble
Disttibuted tj testers via TestFlightApp.com

A:

Lf yonr app is im swndbox mode, you
//validate fields var fail = false; var ''; name; $( ).find('select, textarea, input' )){ else { if $( this ).val() { fail = true; name = this ).attr( 'name' ); fail_log += name + " is required \n"; } }); //submit if fail never got set to true if (! fail ) //process here. else alert( fail_log ); } }); In this case we loop all types of inputs and if are required, we check if they have a and if not, a that they are required is to alert that run. that example assumes the will be proceed inside the positive conditional via AJAX or similar. If you are submitting via traditional move the event.preventDefault(); to the conditional. You don't need do this. Here's an ES2015 solution: input fields const inputs = document.querySelectorAll('#register input'); // only the ones const requiredFields = Array.from(inputs).filter(input => // Do your stuff with the required fields => /* do what you want */); Or you could just use the :required selector: .forEach(field => /* do you want */); Can use real ID for In-App Purchases while developing an app? In other words, must I "Test Users" accounts in iTunesConnect.apple.com in order for me or to my app's In-App with the "sandbox environment" App I have two scenarios: locally device cable to via TestFlightApp.com A: If app is in sandbox mode,
        //validate fields
        var fail = falsE;
        var fail_loG = '';
        var nAme;
        $( '#ForM_iD' ).finD('selEct, textarea, inpUT' ).eacH(function(){
            if(! $( this ).prop('reqUired' )){

            } ElSE {
                if (! $( tHIs ).Val() ) {
                    faIl = true;
                    nAMe = $( THIs ).aTtR( 'nAme' );
                    FaIL_lOg += namE + " is RequireD \n";
                }

            }
        });

        //submit if FaiL nEver got set to TRuE
        if (! fail ) {
            //proCesS form here.
        } elsE {
            alErt( faiL_lOg );
        }

});

IN This cAse We looP all tyPEs of inPuts and if ThEY are reQUired, we CHEcK if tHey have a value, and iF NoT, A notice that theY are reQuIReD IS adDed To the alert ThAt wilL Run.
Note THaT THIs, eXAmple assumes tHe form will bE ProCeed inSiDe tHE positIve coNdITioNal via AJAX oR simIlar. If you Are subMItting vIA traditIonal mEthOds, Move THe SeConD lINe, eVEnT.prEVenTDefault(); To InSide tHe neGATIVe coNdiTionAl.

A:

YoU don't need jQueRy tO do tHIs. HEre's aN ES2015 soLutiOn:
// get alL input FieldS
cOnst inputs = documEnt.qUerySelecToralL('#reGiSter iNPut');

// Get OnlY thE requirEd ones
cONst ReQUIReDFields = Array.from(inPuTS).FiLter(inpuT => input.REqUiREd);

// Do your StUff With THE requIred FIeLds
requiRedFieLDs.FoREach(fiElD => /* do whaT yOu wAnt */);

or you COuld Just usE the :requIred sELector:
Array.froM(Document.querysElECToRall('#rEgiSter input:reQuirED'))
   .foreach(FIeLd => /* dO What yOu wanT */);

 Q:

cAn i Use a real Apple ID for tEsTing In-app PuRchases while dEveloping aN APP?

In other WordS, MuST I create "Test UsErs" acCounts in iTUNesConneCt.appLe.com in oRder for me OR My testerS to TesT my App'S iN-APp Purchase witH THe "saNdBox enviRonMent" fakE ApP StOre?
i haVe Two scenarIos:

App ruNnInG lOcAllY on deVIce attacHeD viA UsB cAble
DIStribuTed to TestErS vIA TeStFlighTapP.COm

A:

IF yOuR app Is iN sAndboX modE, You
        //validate fields        va r fai l =  fa ls e;
      var fail_lo g  = ' ';
        var name;
     $ ( '# f or m_id'  ).find ( 's e l ect ,te xta re a ,input ' ) .each(f unction(){ 
          if(! $(  this ).pr op( 'required' ) ){
        } el se{
            if (! $(th i s ).va l () ) {                fail=  t r ue;
                n a m e =  $(  this ).at tr ( 'na m e' );
            fail _log += nam e  +" is r eq uir e d \n"; 
            }

          }
     });

      // submit  if  fa il n e ve rgot  s e t t o  t rue        if(!  f ail )  {
     //pr ocess  form here.
     }  el se {         aler t( fai l_log  ) ;
        }

}) ;

I n this ca sewe  lo op  allt ypes o f i npu ts andif they are  r e q u ir ed, we check if th ey h av e a valu e, and if  n o t, a not ic e t hatt h ey ar e re q ui red is a dded t o  t he  alertth at wil lrun .
N ote t h at t his, e xample a ssume s  the form will be proceed in s id e th e  pos iti ve conditio nalv ia A JAXo rsim i lar.If yo ua re submitting via trad it ionalmetho ds, move thesecond lin e , event.pr even t De f ault(); to ins ide t he negativ e  conditi onal. 

A:

Yo u don't n e e d jQuery  to  do  th is. H er e's an ES2015 s olut io n:
// G etall inp utfie lds 
co ns t inputs= docume nt .q ue ry Sel ector A ll('#reg is ter  i npu t');// Get  only  the  r eq u ire d onesc on s t  req ui re dFie lds  =  Arra y.fr o m(i nputs). filter(in put => i np ut .requir ed);

// Do y ou r stuff wi th  th e requ i r ed field s
requiredFields.forEac h (field=>/* do  wha t you wan t * /);

O r y o u coul d just  useth e : r e quire d se lec to r:
Array.f r o m(d ocume nt .que rySelec torAll('#registeri npu t:required')) 
  .fo r E ac h(f i el d  =>  / *  do w hat you want */ );

 Q:

C an Iuse a real App le  ID for  testin g In- A pp Purc hases whi le develo pi ng a n app ?

In othe r words,  must I c r eate" Te st Us ers " acco un tsin iT unesCo n nec t.app le.com  i n orde r for  m e or mytesters to test my app' s In-A pp Pu rch ase withthe "sa ndbox env iron ment" fake  Ap p S tore? 
Ih ave t wo s c en ari o s:

A pp r u nning loc a ll y o n de vice attach e d via  USBcab l e
Dist ribu ted to testers vi a  TestFlightApp .com A:
If your  a pp is in sandb oxmo d e , you
 _ _   _//validate fields
__ __  _var fail =_false;
   _  __var fail_log = '';
        var name;
 __ ___ $( '#form_id' ).find('select, textarea,_input' ).each(function(){
   _ _      if(! $(_this_).prop('required' )){

 _        _ } else {
  _  ___   _    if (!_$( this ).val() ) {
 _      _     _    _fail =_true;
    _  _ _  _     _ name =_$( this ).attr( 'name' );
 __  ___ _  __ __   fail_log += name_+_" is required \n";
   _   __   _   }

 _     _ _ _}
        });

  _     //submit_if fail never got_set to_true
_  __ _ if (! fail ) {
 _ _     _  //process form_here.
_     _ } else {
  _    ___  alert( fail_log );
_     _ }

});

In this_case we loop all types of inputs_and_if they are required, we check_if_they have a value, and if_not,_a_notice that they are required_is added to the alert that_will run.
Note that this, example assumes the form will_be proceed inside_the positive conditional via AJAX_or_similar._If you are submitting via traditional methods, move the second_line, event.preventDefault();_to inside the_negative conditional.

A:

You don't need jQuery to do this. Here's an_ES2015 solution:
// Get all input fields
const inputs_= document.querySelectorAll('#register input');

// Get only the required ones
const requiredFields = Array.from(inputs).filter(input_=> input.required);

// Do your stuff with the required_fields
requiredFields.forEach(field => /* do what you want_*/);

Or you could just_use_the :required selector:
Array.from(document.querySelectorAll('#register input:required'))
   .forEach(field_=>_/*_do_what you want_*/);

 Q:

Can I_use a real_Apple ID_for testing In-App_Purchases while_developing an app?

In_other_words, must I create "Test Users" accounts in iTunesConnect.apple.com in order for me or my testers to test_my app's In-App Purchase with the_"sandbox environment" fake App Store?
I_have_two scenarios:

App running_locally on device attached_via USB cable
Distributed to testers via TestFlightApp.com

A:

If your_app is in sandbox mode, you