0

i have two fields in form

file.phtml

     <div class="field">


     <label class="label"><?php /* @escapeNotVerified */echo __('Current quote amount') ?>:</label>
                                <div class="control">
                                    <input type="text" id="price1"
                                           class='input-text'
                                           readonly='readonly'
                                           value="<?php  $sellerlowestquoteDetails=$quoteHelper->getSellerLowestQuote($quote->getId());
                                           $seller_detail='';
                                           //echo 

count($sellerlowestquoteDetails);

                                       if(count($sellerlowestquoteDetails)>0){
                                           foreach($sellerlowestquoteDetails as $sellerlowestquoteDetail){
                                               $seller_detail=$sellerlowestquoteDetail;
                                           }
                                       }
                                       if(count($sellerlowestquoteDetails)>0) {
                                           echo $seller_detail['seller_quote_price'];
                                       }
                                       else{
                                           echo "N/A";
                                       }

                                       //print_r($seller_detail['seller_quote_price']);/* @escapeNotVerified */ //$tt=$quoteHelper->getSellerLowestQuote($quote->getId());


                                       ?>"
                                       name='customer_iiid'
                                />
                            </div>
                        </div>


    <input type="text" id="price2"  class='input-text required-entry validate-number validate-greater-than-zero'         <?php echo ($priceDisabled1)?"readonly='readonly'":''?>
    value="<?php /* @escapeNotVerified */echo $price ?>"
                                            name='seller_quote_price'
                                        />

enter image description here

here have two fields

Filed2 (Should be less than Field1)

data-validate="{required:true, 'validate':less than Filed1}" // i tried add like this

how i can add validation rule in magento 2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.