Jump to content

chris.bacon

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Everything posted by chris.bacon

  1. Nice Thanks that really helped! just a quick one im sure this is not possible as i have never had the need but can i call two separate functions onsubmit()?
  2. Ok folks on my form i use javascript on a dropdown box (months of the year) to show/hide following dropdown boxes using css i.e box1 = 1-28 days default hide this dropdown box2 = 1-30 days default hide this dropdown box3 = 1-31 days default show this dropdown the correct dropdown box will be shown and the others hidden according to the month selected this works fine. JavaScript <script type="text/javascript"> <!-- // var small = 1-28 days // var medium = 1-30 days // var large = 1-31 days function ToggleDays(id) { var small = document.getElementById('short'); var medium = document.getElementById('medium'); var large = document.getElementById('long'); var value = id.options[id.selectedIndex].value; if(value == 2) { small.style.display = "inline"; medium.style.display = "none"; large.style.display = "none"; } if( value==2 || value==4 || value==6 || value==9 || value==11 ) { if(value == 2) { small.style.display = "inline"; medium.style.display = "none"; large.style.display = "none"; } else { small.style.display = "none"; medium.style.display = "inline"; large.style.display = "none"; } } else { small.style.display = "none"; medium.style.display = "none"; large.style.display = "inline"; } } //--> </script> HTML form (part of) <form name="feedback" action="newformverify.php" method="POST" onsubmit='return formValidator()'> <fieldset> <legend>Feedback</legend> <p><label>Name</label> <input id="name" type="text" name="name"/></p> <p><label>Centre</label> <input id="centre" type="text" name="centre"/></p> <p><label>Date of meeting</label> <select id="month" name="month" size="1" onchange="ToggleDays(this);"> <option value=0><?php echo date("F")?></option> <option value=1>January</option> <option value=2>February</option> <option value=3>March</option> <option value=4>April</option> <option value=5>May</option> <option value=6>June</option> <option value=7>July</option> <option value=8>August</option> <option value=9>September</option> <option value=10>October</option> <option value=11>November</option> <option value=12>December</option> </select> I want to use php to gather all info from form together and send in an email using the mail function. however when i post from the select it posts the option value and not the text is there any way to stop this? <?php session_start(); $month=$_POST['month']; echo ("$month"); //this displays either a 0 or 1 etc ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.