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


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -