Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8883455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:48:59+00:00 2026-06-14T20:48:59+00:00

I am working on a website developed by another programmer. There is a form

  • 0

I am working on a website developed by another programmer. There is a form that has a javascript validation before entering data in db. But I dont really understand why I am getting this alerts. See code below:

function save(){
  if (echeck(document.getElementById('email').value)==false){
    document.getElementById('email').focus();
  }else if(document.getElementById('fullname').value==''){
    alert("Full name is required");
    document.getElementById('fullname').focus();
  }else if(document.getElementById('handphone').value==''){
    alert("HP number is required");
    document.getElementById('handphone').focus();
  }else if(document.getElementById('bank_name').value==''){
    alert("Bank Account Name is required");
    document.getElementById('bank_name').focus();
  }else if(document.getElementById('bank_number').value==''){
    alert("Bank Account Number is required");
    document.getElementById('bank_number').focus();
  }else if(document.getElementById('code').value==''){
    alert("Captcha Code cannot be blank");
    document.getElementById('code').focus();
  }else{
    $.post("<?php echo base_url(); ?>index.php/misterjudi/register/", {
      email:document.getElementById('email').value,
      fullname:document.getElementById('fullname').value,
      handphone:document.getElementById('handphone').value,
      bank:document.getElementById('bank').value,
      bank_name:document.getElementById('bank_name').value,
      bank_number:document.getElementById('bank_number').value,
    },
    function(data){
      alert("Successfully registered");
      location.href="<?php echo base_url(); ?>";
    });
  }
}

So it’s checking if the fields are not empty if I understood right. Even though I complete all the fields, I am still getting an alert like (‘Full name is required’).

Thanks in advance for help.

Here is the HTML code:

<table style="border:0px solid #CCC; width:100%;">
  <tr>
    <td style="padding-bottom:10px; width:180px;">Email
      <span style="color:#F00;">*</span></td><td style="padding-left:20px; padding-bottom:10px;">
      <input id="email" type="text" name="email" onblur="check_email(this.value);" />
    </td>
  </tr>
  <tr>
    <td style="padding-bottom:10px;">Nama <span style="color:#F00;">*</span>
    </td>
    <td style="padding-left:20px; padding-bottom:10px;">
      <input id="fullname" type="text" name="fullname" />
    </td>
  </tr>
  <tr>
    <td style="padding-bottom:10px;">No HP <span style="color:#F00;">*</span>
    </td>
    <td style="padding-left:20px; padding-bottom:10px;">
      <input id="handphone" type="text" name="handphone" />
    </td>
  </tr>
  <tr>
    <td style="padding-bottom:10px;">Nama Bank <span style="color:#F00;">*</span></td>
    <td style="padding-left:20px; padding-bottom:10px;">
      <select name="bank" id="bank">
        <?php $data=$this->dubol_model->get_bank(); ?>
        <?php for($i=0;$i<count($data);$i++){ ?>
        <option value="<?php echo $data[$i]['BankCode']; ?>">
          <?php echo $data[$i]['BankName']; ?></option>
          <?php } ?>
      </select>
    </td>
  </tr>
  <tr>
    <td style="padding-bottom:10px;">Nama Rekening <span style="color:#F00;">*</span></td>
    <td style="padding-left:20px; padding-bottom:10px;"><input id="bank_name" type="text" name="bank_account_name" /></td>
  </tr>
  <tr>
    <td style="padding-bottom:10px;">Nomor Rekening <span style="color:#F00;">*</span></td>
    <td style="padding-left:20px; padding-bottom:10px;">
      <input id="bank_number" type="text" name="bank_account_number" />
    </td>
  </tr>
  <tr>
    <td colspan="2">
      <div style="width: 430px; padding-top:20px; padding-bottom:20px; float: left; height:90px; background-color:#FFF; border:1px solid #CCC;">
        <img id="siimage" align="left" style="padding-right: 5px; border: 0" src="<?php echo base_url(); ?>/captcha/securimage_show.php?sid=<?php echo md5(time()) ?>" />
        <script type="text/javascript">
          AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0','width','19','height','19','id','SecurImage_as3','align','middle','src','<?php echo base_url(); ?>/captcha/securimage_play?audio=<?php echo base_url(); ?>/captcha/securimage_play.php&bgColor1=#777&bgColor2=#fff&iconColor=#000&roundedCorner=5','quality','high','bgcolor','#ffffff','name','SecurImage_as3','allowscriptaccess','sameDomain','allowfullscreen','false','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','<?php echo base_url(); ?>/captcha/securimage_play?audio=<?php echo base_url(); ?>/captcha/securimage_play.php&bgColor1=#777&bgColor2=#fff&iconColor=#000&roundedCorner=5' ); //end AC code
        </script>
        <noscript>
          <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="19" height="19" id="SecurImage_as3" align="middle">
            <param name="allowScriptAccess" value="sameDomain" />
            <param name="allowFullScreen" value="false" />
            <param name="movie" value="<?php echo base_url(); ?>/captcha/securimage_play.swf?audio=<?php echo base_url(); ?>/captcha/securimage_play.php&bgColor1=#777&bgColor2=#fff&iconColor=#000&roundedCorner=5" />
            <param name="quality" value="high" />
            <param name="bgcolor" value="#ffffff" />
            <embed src="<?php echo base_url(); ?>/captcha/securimage_play.swf?audio=<?php echo base_url(); ?>/captcha/securimage_play.php&bgColor1=#777&bgColor2=#fff&iconColor=#000&roundedCorner=5" quality="high" bgcolor="#ffffff" width="19" height="19" name="SecurImage_as3" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
          </object>
        </noscript><br />
        <!-- pass a session id to the query string of the script to prevent ie caching -->
        <a tabindex="-1" style="border-style: none" href="#" title="Refresh Image" onClick="document.getElementById('siimage').src = '<?php echo base_url(); ?>/captcha/securimage_show.php?sid=' + Math.random(); return false"><img src="<?php echo base_url(); ?>/captcha/images/refresh.gif" alt="Reload Image" border="0" onClick="this.blur()" align="bottom" /></a>
      </div>
    </td>
  </tr>
  <tr>
    <td style="padding-top:10px;">Code <span style="color:#F00;">*</span></td>
    <td style="padding-top:10px;">
      <input id="code" type="text" name="code" size="12" />
    </td>
  </tr>
  <tr>
    <td colspan="2" style="padding-top:20px;">
      <input type="button" value="    Close    " onclick="$('#register').animate({  height: 'toggle', opacity: 'toggle'}, 1000);" />
      <input type="button" value="Register" onclick="save();" />
    </td>
  </tr>
</table>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T20:49:00+00:00Added an answer on June 14, 2026 at 8:49 pm

    Type:
    console.log(document.getElementById(‘fullname’).value, document.getElementById(‘fullname’).value === ”);
    before the line ‘alert(“Fullname is required”);’ to debug.

    This code gonna print in your web inspector console the value of that input and is it equals to empty string. I guess it’ll help you understand the issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have developed a simple php contact form, that's working fine, but i am
Working on a website that has Employee and Branch entities, using a database table
We are working on a website that has tons of images and one of
I have been working on a multilingual website which has been developed in ASP.net
I have developed a website: http://dannalab.com which was working fine. But now in Chrome
I developed the mobile website on Jquery Mobile and C#. It is working but
I have a website that per original developer was working on local environment. I
I have working website in PHP with a MySQL backend which has several tables
My website is working fine on IE, but when I open it on Firefox,
Im working on a website (html,css,javascript, ajax, php,mysql), and I want to restrict the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.