jmc92 Posted May 17, 2009 Share Posted May 17, 2009 Ok I have this code <input type="file" name="q2" style="width:200" value="" /> <input type="submit" name="Submit" value="Run" onclick="location.href=q2.value" /> how do I add a second button that will open the file in a new window?Thanks in advance Link to comment Share on other sites More sharing options...
chibineku Posted May 17, 2009 Share Posted May 17, 2009 http://www.javascript-coder.com/window-pop...ndow-open.phtmlPretty useful, self-explanatory link Link to comment Share on other sites More sharing options...
Ingolme Posted May 17, 2009 Share Posted May 17, 2009 For security reasons, Javascript doesn't have access to the value of file type inputs. Link to comment Share on other sites More sharing options...
jmc92 Posted May 17, 2009 Author Share Posted May 17, 2009 Well it works for the device im coding forI just need the buttonbut I still havnt figured it out Link to comment Share on other sites More sharing options...
Ingolme Posted May 17, 2009 Share Posted May 17, 2009 <input type="file" id="q2" style="width:200px" value="" /><button type="button" onclick="window.open(document.getElementById('q2').value)">Run</button> Link to comment Share on other sites More sharing options...
jmc92 Posted May 18, 2009 Author Share Posted May 18, 2009 Well it works for the device im coding forI just need the buttonbut I still havnt figured it out <input type="file" id="q2" style="width:200px" value="" /><button type="button" onclick="window.open(document.getElementById('q2').value)">Run</button> Thank you! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.