jeudi 12 juillet 2018

how to change form values on selecting required values using laravel 5 and js

I am facing a problem couples of hours has been passed but i am not able to find my solution. what i want is i have a from where i am adding a property in my form there two radio buttons 1- Vacational 2- Longterm .

If i select vacational and submit my form my form values submitted after submitting the values are shown on front end and there is button Rates when i click on this button the popup appears:

It shows 1- Season 2- Dates 3- Daily 4- Weekly 5- Monthly ( in case if i select radion button vacational) what i want here if i select radio button longterm the form should display value 1- Season 2- Dates 3- Monthly not daily and weekly but i am unable to show my required values:

My HTML where radio options is:

      <label class="radio-inline">
              <input type="radio" id="inlineCheckbox1" value="is_vacation" name="property_type" checked> Vacation
            </label>
            <label class="radio-inline">
              <input type="radio" id="inlineCheckbox2" value="is_long_term" name="property_type"> Long Term
            </label>

and i am doing like this of js code:

 function longterm(){
alert("1");
document.getElementById('daily').style.display ='none';
document.getElementById('weekly').style.display ='none';
    } 

and my form where i am giving ids:

  <thead>
              <tr>
                <th>Season</th>
                <th>Dates</th>
                <th id="daily" style="width: 150px; ">Daily</th>
                <th id="weekly" style="width: 150px; ">Weekly</th>
                <th id="monthly"  style="width: 150px; ">Monthly</th>

              </tr>
            </thead>

I want to display only 3 options 1 - Season 2- Dates 3- Monthly how i can do that your help will be really appreciated! Need your help!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire