Jump to content

sho88

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

sho88's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi guys, basically, I've got a web application I'm working on for someone; they want a system where they can book drivers, and they want a tick box where they can check the availability of a driver. The check box name is "field14" and has default value of "1" for ticked and "0" for unticked. Now, i've INSERT into the database a ticked box so in the "available" field is has "1" meaning yes, the people is available....but now the problem is if I want to tick off and say they're unavailable, how would I do that, because everytime I tick off it still represents the value of "1" and shows them as available.... Here is some code: if (($field14)==1) { echo "<p><label>ADR in Tank Class 1</label><input type='checkbox' name='field14' value='1' checked/></p><br /><br />"; } else { echo "<p><label>ADR in Tank Class 1</label><input type='checkbox' name='14' value='0'/></p>"; } I would really appreciate your help. Thanks
  2. Basically, when I click on submit, it goes to the next page, the JavaScript code doesn't check the fields first.... how do i get it to check if or if all fields are empty?
  3. Hi guys, I'm sure this sounds very silly, but I'm not a JavaScript guy, not as good with the basic fundamentals, however, I'm more of a PHP, HTML, CSS guy, so here's my problem. At the moment, I'm having troubles with my form validation. Could anyone have a look and see if there's any problem asap please? Many thanks Sho. Javascript.js // JavaScript Document window.onload = validation_1(); function validation_1() { if (document.login.username.value == "") { document.getElementById("error_username").style.display = "inline"; document.login.username.focus(); return false; } } form.php <div class="login"> <h3>Please login to your account.</h3> <form id="form1" method="post" action="loginAuth.php" id="login" onsubmit="return validation_1(); "> <div class="form-row"> <span class="label">User Name</span> <input type="text" name="un" class="adduser" id="username" /> <div id="error_username" style="color:#C00; display:none;">***</div> <br /><br /><br /> <span class="label">Password</span> <input type="password" name="pw" class="adduser" id="password" /> <div id="error_password" style="color:#C00; display:none;">***</div> <br /><br /><br /> <input type="submit" value="Login" style="padding:5px;" /> </div> </form> </div> <img src="img/index.png" title="Home Page" style="float:right; margin-top:-280px; margin-right:80px;" />
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.