로그인창 크기 문제입니다. > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

로그인창 크기 문제입니다. 정보

로그인창 크기 문제입니다.

본문

여기서 다운받은 소슨데
비밀번호 입력창크기가 마우스 가져가면 변해요
어떻게하면 크기가 고정될까요.. 도와주세요.
소스입니다.
==============================================================
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include("$g4[path]/config.php");

if ($g4['https_url']) {
    $outlogin_url = $_GET['url'];
    if ($outlogin_url) {
        if (preg_match("/^\.\.\//", $outlogin_url)) {
            $outlogin_url = urlencode($g4[url]."/".preg_replace("/^\.\.\//", "", $outlogin_url));
        }
        else {
            $purl = parse_url($g4[url]);
            if ($purl[path]) {
                $path = urlencode($purl[path]);
                $urlencode = preg_replace("/".$path."/", "", $urlencode);
            }
            $outlogin_url = $g4[url].$urlencode;
        }
    }
    else {
        $outlogin_url = $g4[url];
    }
}
else {
    $outlogin_url = $urlencode;
}

?>

<script type="text/javascript" src="<?=$g4[path]?>/js/capslock.js"></script>
<script type="text/javascript">
// 엠파스 로긴 참고
var bReset = true;
function chkReset(f)
{
    if (bReset) { if ( f.mb_id.value == '아이디' ) f.mb_id.value = ''; bReset = false; }
    document.getElementById("pw1").style.display = "none";
    document.getElementById("pw2").style.display = "";
}
</script>               

<!-- 로그인 전 외부로그인 시작 -->
<form name="fhead" method="post" onsubmit="return fhead_submit(this);" autocomplete="off" style="margin:0px;">
<input type="hidden" name="url" value="<?=$outlogin_url?>">
<table width="1050" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="1050" height="36" class="top_loginbox"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="1050" height="8"></td>
            </tr>
            <tr>
              <td width="1050" height="20"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="22" height="20"></td>
                  <td width="20" height="20"><input type="checkbox" name="auto_login" value="1" onclick="if (this.checked) { if (confirm('자동로그인을 사용하시면 다음부터 회원아이디와 패스워드를 입력하실 필요가 없습니다.\n\n\공공장소에서는 개인정보가 유출될 수 있으니 사용을 자제하여 주십시오.\n\n자동로그인을 사용하시겠습니까?')) { this.checked = true; } else { this.checked = false; } }"></td>
                  <td width="62" height="20" class="top_loginbox_text">아이디저장</td>
                  <td width="10" height="20"></td>
                  <td width="110" height="20"><input name="mb_id" type="text" class="top_loginbox_text" value="아이디" size="17" maxlength="20" required itemname="아이디" value='아이디' onMouseOver='chkReset(this.form);' onFocus='chkReset(this.form);'></td>
                  <td width="5" height="20"></td>
          <td width="110" id=pw1 colspan="2"><input name="textfield2" type="text" class="top_loginbox_text" value="비밀번호" size="17" maxlength="20" required itemname="패스워드" value='패스워드' onMouseOver='chkReset(this.form);' onfocus='chkReset(this.form);'></td>
          <td id=pw2 style='display:none;' colspan="2"><input name="mb_password" id="outlogin_mb_password" type="password" class="top_loginbox_text" size="17" maxlength="20" itemname="패스워드" onMouseOver='chkReset(this.form);' onfocus='chkReset(this.form);' onKeyPress="check_capslock(event, 'outlogin_mb_password');"></td>
                  <td width="5" height="20"></td>
                  <td width="110" height="20"><input type="image" src="<?=$outlogin_skin_path?>/img/login_top.gif" alt="" width="110" height="20" border="0"/></td>
                  <td width="28" height="20"></td>
                  <td width="150" height="20" class="top_loginbox_text"><a href="<?=$subpage_url?>&subcon=Login3">아이디 찾기</a> . <a href="#">비밀번호찾기</a></td>
                  <td height="20"><span class="center_board">ㅣ&nbsp;</span><a href="<?=$g4['bbs_path']?>/register.php"><b><font color="#000000">회원가입</font></b></a></td>
                  <td width="278" height="20">&nbsp;</td>
                </tr>
              </table></td>
            </tr>
            <tr>
              <td width="980" height="8"></td>
            </tr>
          </table></td>
        </tr>
      </table>
</form>                 
<map name="Map" id="Map">
<area shape="rect" coords="1,0,28,8" href="#" />
<area shape="rect" coords="44,0,72,8" href="#" />
<area shape="rect" coords="87,0,125,8" href="#" />
<area shape="rect" coords="141,0,201,8" href="#" />
</map>

<script type="text/javascript">
function fhead_submit(f)
{
    if (!f.mb_id.value) {
        alert("회원아이디를 입력하십시오.");
        f.mb_id.focus();
        return false;
    }

    if (document.getElementById('pw2').style.display!='none' && !f.mb_password.value) {
        alert("패스워드를 입력하십시오.");
        f.mb_password.focus();
        return false;
    }

    <?
    if ($g4[https_url])
        echo "f.action = '$g4[https_url]/$g4[bbs]/login_check.php';";
    else
        echo "f.action = '$g4[bbs_path]/login_check.php';";
    ?>

    return true;
}
</script>
<!-- 로그인 전 외부로그인 끝 -->
==============================================================
도와주세요~ㅠ
  • 복사

댓글 전체

<td width="110" id=pw1 colspan="2"><input name="textfield2" type="text" class="top_loginbox_text" value="비밀번호" size="17" maxlength="20" required itemname="패스워드" value='패스워드' onMouseOver='chkReset(this.form);' onfocus='chkReset(this.form);'></td>
<td id=pw2 style='display:none;' colspan="2"><input name="mb_password" id="outlogin_mb_password" type="password" class="top_loginbox_text" size="17" maxlength="20" itemname="패스워드" onMouseOver='chkReset(this.form);' onfocus='chkReset(this.form);' onKeyPress="check_capslock(event, 'outlogin_mb_password');"></td>
여기 보시면 평상시 화면에 보여지는 패스워드 입력창은 textfield2입니다.
포커스를 얻게 되면 textfield2는 id=pw1의 display속성이 none으로 되어 화면에 보이지 않게 되고 대신 id=pw2가 화면에 보여지게 됩니다.
input 속성이 password이면 value값의 한글(패스워드)이 ******이렇게 보여지기 때문에 이런 방법을 쓰고 있습니다.
한글과 *는 문자 폭(가로 픽셀)에 차이가 있어서 가로 크기를 cols로 지정하게 되면 입력창의 크기가 변하게 됩니다.
이럴 땐 textfield2와 password의 가로 폭을 style속성에서 width를 같게 해주면 됩니다.
<td width="110" id=pw1 colspan="2"><input name="textfield2" type="text" class="top_loginbox_text" value="비밀번호" size="17" maxlength="20" required itemname="패스워드" value='패스워드' onMouseOver='chkReset(this.form);' onfocus='chkReset(this.form);' style='width:120px;'></td>
<td id=pw2 style='display:none;' colspan="2"><input name="mb_password" id="outlogin_mb_password" type="password" class="top_loginbox_text" size="17" maxlength="20" itemname="패스워드" onMouseOver='chkReset(this.form);' onfocus='chkReset(this.form);' onKeyPress="check_capslock(event, 'outlogin_mb_password');" style='width:120px;'></td>
© SIRSOFT
현재 페이지 제일 처음으로