• Das Erstellen neuer Accounts wurde ausgesetzt. Bei berechtigtem Interesse bitte Kontaktaufnahme über die üblichen Wege. Beste Grüße der Admin

help me plz, got a problem

Luke

New member
hello,
i got an java script problöem, and i cant sove it.
i want to create an formularcheck with buttons, like with "confirm", but the two boxes should be yes and no, and not "ok" and "cancel", how can i change this?
plz help me, and reply to my question
 
Hi,

After browsing selfhtml and the scripts on this page I have not found a suitable solution for your problem. Though I must admit, I am no Javascript pro..

The only thing I can think of is a server side solution using another HTML form in a popup window to ask for confirmation....

maybe some of the guys around here know a better way...


regards,

Albu
 
Hello Luke!

Theres no way to fix that with the confirm-method.

A alternative way is to define a <div>-Layer with 2 buttons(with values - YES and NO) and a script thats hide and show this layer, like this one:
Code:
<script language="Javascript">
var height = screen.height;
var width = screen.width;
var agt=navigator.userAgent.toLowerCase();
var msie  = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var ns4  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
var ns6 = (ns4 && (parseInt(navigator.appVersion) == 5));

function shlayer(laname)
{
    if(msie)
    {
         if(document.all.laname.visibility=='hidden')
         {
               document.all.laname.style.left = (width/2) - (document.all.laname.style.width/2);
               document.all.laname.style.top = (height/2) - (document.all.laname.style.height/2);
               document.all.laname.visibility = "visible";
         }         
    }
    if(ns6)
    {
         if(document.getElementById(laname).visibility=='hidden')
         {
               document.getElementById(laname).style.left = (width/2) - (document.getElementById(laname).style.width/2);
               document.getElementById(laname).style.top = (height/2) - (document.getElementById(laname).style.height/2);
               document.getElementById(laname).visibility = "visible";
         }           
    }
    else if(ns4)
    {
          if(document[laname].visibility=='hide')
         {
               document[laname].left = (width/2) - (document[laname].width/2);
               document[laname].top = (height/2) - (document[laname].height/2);
               document[laname].visibility = "show";
         } 
    }
}

function hidelayer(laname)
{
    if(msie)
    {
          if(document.all.laname.visibility=='visible')
          {
               document.all.laname.visibility="hidden";
          }
    }
    if(ns6)
    {
          if(document.getElementById(laname).visibility=='visible')
          {
               document.getElementById(laname).visibility="hidden";
          }
    }
    else if(ns4)
    {
          if(document[laname].visibility=='show')
          {
               document[laname].visibility="hide";
          }
    }
}

function doConfirm(isok)
{
    switch(isok)
    {
         case 0:
         hidelayer('confirmation');
         break;
         
         case 1:
         ...........
         break;
    }
}
</script>

The points above, below case 1: have to replaced by your action.
Below follows the HTML-part:
Code:
<div id="confirmation" style="position:absolute;left:0px;top:0px;width:150px;height:100px;visibility:hidden">
<input type="button" value="YES" onClick="doConfirm(1)">
>input type="button" value="NO"  onClick="doConfirm(0)">
</div>

Now there have to be a button whos show the confirmation dialog, like this:
<input type="button" onClick="shlayer('confirmation')">

Oh, the Design of the Confirmation-Box should be changed because there would be 2 Buttons without any background in center of screen and that looks not so good.

Thats all

I have not test the script so I dont know if it do his work.
__________________________

CU
..::Comet::..
 
Zuletzt bearbeitet:
thx

danke habt mir geholfen denk ich sieht zumindest gut aus, werds gleich dann mal eibauen cu....
 
Hey Luke!

Du kannst ja deutsch. Nächstes mal gleich in Deutsch posten dann muß ich meine grauen Zellen nicht so strapazieren. ;)
 
jo sorry

meine icq uin falls ist 95366325.
danke für deine hilfe, war echt ql von dir.
meld dich mal, vielleicht kann ich dir ja auch mal wo helfen :)
 
Zurück
Oben