Hallo Leute,
ich habe gleich zwei Frage:
1. Wie kann ich mit einem Dropdown-Select-Feld gleich zwei Werte übergeben? (Hier Breite und Höhe eines Kamerasensors)
2. Wie kann alternativ dazu zwei input-Felder anbieten, in die man die Werte manuell eintragen kann? (Diese Felder sollen Vorrang haben, idealerweise werden die Werte aus dem Dropdown hier auch angezeigt werden)
Hier mein bisheriger (ungepflegter) Code:
(Über einiges bitte nicht wundern, es wird eine Webseite fürs iPhone)
Ein_03 und Ein_03a sollten per Dropdown-Menü erzeugt werden.Code:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html DELETE_manifest="/DELETE_fov.manifest"> <head><title>FoV</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" /> <meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-status-bar-style" content="black" /> <style type="text/css"> <!-- input { font-family:Arial,sans-serif; color:#FFFFFF; font-size:12px; text-align:right; border:none; background-color: #333; height:15px; width:50px; padding:2px; } body { background-color: #999; } --> </style> </head> <body> <form name="Test" action=""> <blockquote> <p> Select a Camera:<br /> <select name="Ein_03b"> <option value="36">Camera 01</option> <option value="49">Camera 02</option> <option value="76">Camera 03</option> </select><br /> or custom sensor size:<br /> Bh <input name="Ein_03" type="tel" value="49" onfocus="this.value = ''">mm x Bv <input name="Ein_03a" type="tel" value="37" onfocus="this.value = ''">mm<br /><br /> f <input name="Ein_01" type="tel" value="23" onfocus="this.value = ''">mm<br /> d <input name="Ein_02" type="tel"value="200" onfocus="this.value = ''">m<br /><br /><br /> αh <input name="Aus_01" type="text" value="0" readonly="readonly">° <br /> αv <input name="Aus_01a" type="text" value="0" readonly="readonly">°<br /> Gh <input name="Aus_02" type="text" value="0" readonly="readonly">m<br /> Gv <input name="Aus_02a" type="text" value="0" readonly="readonly">m<br /><br /> <input type="button" value="FoV" onclick= "Test.Aus_01.value =Math.round(100*(2*(Math.atan(Test.Ein_03.value/(2*Test.Ein_01.value))*180) / (Math.PI)))/100; Test.Aus_02.value =Math.round(100*(2*(Test.Ein_02.value)*(Math.tan((2*(Math.atan(Test.Ein_03.value/(2*Test.Ein_01.value))))/2))))/100; Test.Aus_01a.value =Math.round(100*(2*(Math.atan(Test.Ein_03a.value/(2*Test.Ein_01.value))*180) / (Math.PI)))/100; Test.Aus_02a.value =Math.round(100*(2*(Test.Ein_02.value)*(Math.tan((2*(Math.atan(Test.Ein_03a.value/(2*Test.Ein_01.value))))/2))))/100"> </p> </blockquote> </form> </body></html>
Vielen Dank im Voraus!
Barkeeper
Individualität ist der Unterschied zwischen Kunst und Kompetenz.
Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)