javascript - How can i get data from two input field under a radio button -
i have form used radio button. when user select file, input field of file show , when select text input field of text show. problem how can data radio button have 2 input field.
<div class="span7"> <b>select file or link</b> <input type="radio" name="telephone" value="filelink1" id="rad1" checked="" />file <input type="radio" name="telephone" value="filelink2" id="rad2" />link </div> <div class="span7" id="linkname"> <b>press release link</b> <br/> <input type="text" name="link" placeholder="press link" /> </div> <div class="span7" style="margin-left:42px;display: none;" id="filename"> <b>press release file</b> <br/> <input type="file" name="file" /> </div> <!--onselect radio button -->
try
if ($_get['telephone'] == 'filelink1') { $val = $_get['file']; } else { $val = $_get['link']; }
ps:change method if don't use get