Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. alert error in sign-up form

alert error in sign-up form

Scheduled Pinned Locked Moved Web Development
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    N Q H
    wrote on last edited by
    #1

    Hi all I have a form. In this form, there's a text box and a submit button. The problem is that I have to check what user puts to the text box before he can submit form. If the text box is blank I want to alert a error message(not a alert message) to the form. I intend to use a tag to block a error message. The code as bellow: function f_check() { //how to change the attribute <b>display:none</b> to <b>display:block</b> to show the message } Required Information Thanks in advanced [N][Q][H]

    Y 1 Reply Last reply
    0
    • N N Q H

      Hi all I have a form. In this form, there's a text box and a submit button. The problem is that I have to check what user puts to the text box before he can submit form. If the text box is blank I want to alert a error message(not a alert message) to the form. I intend to use a tag to block a error message. The code as bellow: function f_check() { //how to change the attribute <b>display:none</b> to <b>display:block</b> to show the message } Required Information Thanks in advanced [N][Q][H]

      Y Offline
      Y Offline
      Yusuf
      wrote on last edited by
      #2

      This should get you started. You need to clean up the code, for instance the toggle_visibility is not what you need.

      function f_check()
      {
      var str = document.getElementById('txt_id').value;
      if(str.length == 0)
      toggle_visibility('span_id');
      }

      function toggle_visibility(id)
      {
      var e = document.getElementById(id);
      if(e.style.display == 'block')
      e.style.display = 'none';
      else
      e.style.display = 'block';
      }

      Yusuf Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups