high, benötige dringend und kurzfristig kleines javascript !!!
1. in einem iframe !!! (nicht frameset) ist die seite art-meta.htm mit 2 bis max. 10 produkten.
2. nach klick auf den jeweiligen artikel (bestell-button) soll auf einne neue seite im iframe weitergeleitet werden -> erfassen-form.htm
es müssen aber aus art-meta einige angaben durchgereicht werden (z.B. kurzbeschreibung 2-4 preise
3. diese angaben sollen in erfassen-form.htm aufgeführt werden - und es wird in erfassen-form auch die adresse und einige abprüfungen vorgenommen
die adresse soll in einem cookie abgespeicher werden
4. nach ausfüllen von erfassen-form soll eine bestellung mit den angaben aus 3 in einer seite order.htm aufgeführt werden
5. alles muss im iframe (der heisst ecd) ablaufen
zur info: das hat mal schon alles funktioniert (in framesets) soll aber jetzt in iframe genauso gehen.
vielen dank für die hilfe - auch per mail kontakt erwünscht info@reinhard-lange.de
gruss reinhard
anbei der js-code von erfassen-form.htm:
<script language="Javascript" src="cookie.js"></script>
<script language="Javascript">
var expdate = new Date ();
FixCookieDate (expdate);
expdate.setTime (expdate.getTime() + (365 * 24 * 3600 * 1000));
var orderinfo, mprice, nprice;
function cacheOrder(tmp1,tmp2,tmp3) {
orderinfo = tmp1; mprice = tmp2; nprice = tmp3;
top.start.content.document.location.href = "erfassen-form.html";
}
var firma = GetCookie("firma"), salutatory = GetCookie("salutatory");
var salutatoryv = GetCookie("salutatoryv"), lastname = GetCookie("lastname");
var firstname = GetCookie("firstname"), address1 = GetCookie("address1");
var address2 = GetCookie("address2"), zipcode = GetCookie("zipcode");
var city = GetCookie("city"), phone = GetCookie("phone");
var fax = GetCookie("fax"), email = GetCookie("email");
var url = GetCookie("url"), mbofguild = GetCookie("mbofguild");
var guild = GetCookie("guild"), association = GetCookie("association");
function cacheAddress() {
firma = top.start.content.document.zvehform.firma.value;
salutatory = top.start.content.document.zvehform.salutatory.options[top.start.content.document.zvehform.salutatory.options.selectedIndex].value;
salutatoryv = top.start.content.document.zvehform.salutatory.options.selectedIndex;
firstname = top.start.content.document.zvehform.firstname.value;
lastname = top.start.content.document.zvehform.lastname.value;
address1 = top.start.content.document.zvehform.address1.value;
address2 = top.start.content.document.zvehform.address2.value;
zipcode = top.start.content.document.zvehform.zipcode.value;
city = top.start.content.document.zvehform.city.value;
phone = top.start.content.document.zvehform.phone.value;
fax = top.start.content.document.zvehform.fax.value;
email = top.start.content.document.zvehform.email.value;
url = top.start.content.document.zvehform.url.value;
if (top.start.content.document.zvehform.mbofguild.checked) {
mbofguild = top.start.content.document.zvehform.mbofguild.value;
} else { mbofguild = ""; }
guild = top.start.content.document.zvehform.guild.value;
association = top.start.content.document.zvehform.association.value;
SetCookie("firma", firma, expdate);
SetCookie("salutatory", salutatory, expdate);
SetCookie("salutatoryv", salutatoryv, expdate);
SetCookie("firstname", firstname, expdate);
SetCookie("lastname", lastname, expdate);
SetCookie("address1", address1, expdate);
SetCookie("address2", address2, expdate);
SetCookie("zipcode", zipcode, expdate);
SetCookie("city", city, expdate);
SetCookie("phone", phone, expdate);
SetCookie("fax", fax, expdate);
SetCookie("email", email, expdate);
SetCookie("url", url, expdate);
SetCookie("mbofguild", mbofguild, expdate);
SetCookie("guild", guild, expdate);
SetCookie("association", association, expdate);
checkForm();
}
function getAddress() {
if (firma) { top.start.content.document.zvehform.firma.value = firma; }
if (salutatoryv) { top.start.content.document.zvehform.salutatory.options[salutatoryv].selected = true; }
if (firstname) { top.start.content.document.zvehform.firstname.value = firstname; }
if (lastname) { top.start.content.document.zvehform.lastname.value = lastname; }
if (address1) { top.start.content.document.zvehform.address1.value = address1; }
if (address2) { top.start.content.document.zvehform.address2.value = address2; }
if (zipcode) { top.start.content.document.zvehform.zipcode.value = zipcode; }
if (city) { top.start.content.document.zvehform.city.value = city; }
if (phone) { top.start.content.document.zvehform.phone.value = phone; }
if (fax) { top.start.content.document.zvehform.fax.value = fax; }
if (email) { top.start.content.document.zvehform.email.value = email; }
if (url) { top.start.content.document.zvehform.url.value = url; }
if (mbofguild == "yes") { top.start.content.document.zvehform.mbofguild.checked = true; }
if (guild) { top.start.content.document.zvehform.guild.value = guild; }
if (association) { top.start.content.document.zvehform.association.value = association; }
}
function checkForm() {
var test = true, arrayOfStrings, i=0, errormsg = new Array(), error_msg;
arrayOfStrings = top.start.content.document.zvehform.firma.value.split(" ");
if (arrayOfStrings.length == (top.start.content.document.zvehform.firma.value.length)+1) {
i++; errormsg[i] = "Geben Sie bitte Ihren Firmennamen an!\n"; }
if (arrayOfStrings.length == (top.start.content.document.zvehform.lastname.value.length)+1) {
i++; errormsg[i] = "Geben Sie bitte Ihren Namen an!\n"; }
if (arrayOfStrings.length == (top.start.content.document.zvehform.address2.value.length)+1) {
i++; errormsg[i] = "Geben Sie bitte Ihre Strasse an!\n"; }
if (arrayOfStrings.length == (top.start.content.document.zvehform.zipcode.value.length)+1) {
i++; errormsg[i] = "Geben Sie bitte Ihre PLZ an!\n"; }
if (arrayOfStrings.length == (top.start.content.document.zvehform.city.value.length)+1) {
i++; errormsg[i] = "Geben Sie bitte Ihren Ort an!\n"; }
if (arrayOfStrings.length == (top.start.content.document.zvehform.phone.value.length)+1) {
i++; errormsg[i] = "Geben Sie bitte Ihre Telefonnummer an!\n"; }
if (arrayOfStrings.length == (top.start.content.document.zvehform.fax.value.length)+1) {
i++; errormsg[i] = "Geben Sie bitte Ihre Telefaxnummer an!\n"; }
if (top.start.content.document.zvehform.mbofguild.checked) {
if (arrayOfStrings.length == (top.start.content.document.zvehform.guild.value.length)+1) {
i++; errormsg[i] = "Geben Sie bitte Ihre Innung an!\n"; }
if (arrayOfStrings.length == (top.start.content.document.zvehform.association.value.length)+1) {
i++; errormsg[i] = "Geben Sie bitte Ihren Landesverband an!\n"; } }
if (i > 0) {
test = false;
error_msg = "Zentralverband der Deutschen Elektro-\nund Informationstechnischen Handwerke\n\n";
error_msg = error_msg + "Füllen Sie bitte alle Pflichtfelder vollständig aus!\t\t\n\n";
for (i in errormsg) {
error_msg = error_msg + i + ". " + errormsg[i]; }
alert(error_msg); }
if (test) { top.start.content.document.location.href = "order.htm"; }
}
function opmdrucken() {
if (window.print) self.print();
if (document.all && navigator.appVersion.substring(22,23) == 4) {
self.focus();
var OLECMDID_PRINT = 6;
var OLECMDEXECOPT_DONTPROMPTUSER = 2;
var OLECMDEXECOPT_PROMPTUSER = 1;
var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH="0" HEIGHT="0" CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd',WebBrowser);
WebBrowser1.ExecWB(OLECMDID_PRINT,OLECMDEXECOPT_DONTPROMPTUSER);
WebBrowser1.outerHTML = '';
}
}
</script>