Search Results

Search found 2 results on 1 pages for 'guzh'.

Page 1/1 | 1 

  • Serialize checkbox array, also get checkboxes with off-value

    - by guzh
    Hi, I was wondering if this is possible. The serialize-string will be inserted in a mySQL-database, so it would be fine if all checkboxes would be inserted and not only the ones that is ticked(on). it's possible to make on column in the database for each of the checkboxes, and use this if/else-statement: if(isset($_GET['checkbox'])) { // It's checked! } else { // not checked! } but its a bit unappropriate...

    Read the article

  • serializeArray doesn't include submit-button value

    - by guzh
    Hi, I got two submit buttons in a form. One that deletes the post, and one to edit it. I want to display a fancybox with either the edit-form or a message saying that the user deleted the post. It's all decided by which button was pushed, with a "if(isset)"-sentence in edit.php. However I can't figure out how to get the value of the button within the serializeArray.. I tried with .click(function() instead, but that didn't send anything to the fancybox.. $("#form").bind("submit", function() { $.ajax({ type : "POST", cache : false, url : "edit.php", data : $(this).serializeArray(), success: function(data) { $.fancybox(data); } }); return false; }); The form looks like this: <form method='post' action='' id="form"> <input type='submit' value='Edit' name='edit' /> <input type='submit' value='Delete' name='delete' onClick="return slett('<?php echo $oppgave->name; ?>')"/> <input name='oppgaveID' type='hidden' value='<?php echo $oppgave->id; ?>' /> </form> I would really appreciate it if someone could help me! Thanks in advance!

    Read the article

1