Jump to content

Check box to go to next step ..help..


Chrisislost86

Recommended Posts

Hello people

 

I am a complete novice to code and any help would be appreciated.

 

I am trying to get a check box to move the process to the next step. I have the check box on my test server but need to get the submit button to link do something now.

 

if($level==60){mysql_query("insert into project_status (status_id, status_project_id, status_claim_number)values('80', '$project_id', '0')");$new_status=80;}

 

Level 60 is the stage it is at now and don't want it to go to level 80 till the check box is ticked. Really hope this is making sense to someone.

 

This is my HTML code for my check box, probably not the best but I’m completely new to this.

 

<br />

<input type="checkbox" name="personal" value="checkbox" method="post">

    All figures In?

<INPUT TYPE = "Submit" Name = "Submit1" VALUE = "Submit">

</td>

 

Link to comment
Share on other sites

Give the checkbox a more appropriate value and then test for it. Also check your HTML, there is no method attribute in a checkbox element.

 

<?php
if($_POST) {
/* is the checkbox checked? */
if($_POST['personal'] == 'checked') {
   /* yes it has */
}
else {
   /* no it hasn't */
}
}
?>


<input type="checkbox" name="personal" value="checked" />

Link to comment
Share on other sites

on my SQL data base the field is called level so i don't want it to go to the next level. I still want it to do all the stuff that’s in the code just not till this check box is ticked and submitted.

 

Sorry if i sound bum but i really i am compared to you guys.

 

Link to comment
Share on other sites

Look at my code again. It is clearly commented. Fit your logic into the appropriate bits. I strongly suggest a book if you are a complete novice. Without actually writing the whole thing for you, there is not much more to put in a response. This is so simple.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.