-
if(isset($_POST['submit']))
-
{
-
mysql_query("UPDATE Blad1 SET
-
Naam ='$naamveld',
-
Inkoop='$inkoopveld',
-
Verkoopprijs='$verkoopveld',
-
Aantal ='$aantalveld',
-
Verkocht= '$verkochtveld'
-
WHERE id = '$id'")
-
or die(mysql_error());
-
echo "Het is aangepast!";
-
}
The above text is an example of a submit, and the below text is an example of the input button. -
echo "<td><div><input type=\"image\" name=\"submit2\" id=\"button\" src=\"img/onebit_20.png\" value=\"Maak aan!\">";
-
echo "</div></td>";
It's using this jQuery - $(document).ready(function(){
-
//Setting some variables needed, don't edit these
-
var displaySubmit=false, newRowCount=0;
-
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
//Define some variables - edit to suit your needs
-
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
var maxRows=5;
-
var rowSpeed = 300;
-
var $table = $("#tabel");
-
var $tableBody = $("tbody",$table);
-
var $addRowBtn = $("#addRow");
-
var $removeAllBtn= $("#controls #removeAllRows");
-
var $hiddenControls = $("#controls .hiddenControls");
-
var blankRowID = "blankRow";
-
var newRowClass = "newRow";
-
var oddRowClass = "rowOdd";
-
var evenRowClass = "rowEven"
-
var hiddenClass = "hidden"
-
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-
-
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
//click the add button
-
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
$addRowBtn.click(function(){
-
if(newRowCount < maxRows){
-
newRowCount++;
-
//get the class on the first row...
-
if($tableBody.find("tr:first-child").hasClass(evenRowClass)){
-
//the curent first row is even, so we add an odd class
-
newClasses = hiddenClass+" "+newRowClass+" "+oddRowClass;
-
}else{
-
//the current first row is odd, so we add an even row
-
newClasses = hiddenClass+" "+newRowClass+" "+evenRowClass;
-
}
-
//clone the blank row, put the clone at the top, set the correct classes, remove the ID, animate the divs inside
-
//normally I'd use .addClass(), but I want the classes I set to replace the current set classes, so I use .attr("class") to overwrite the classes
-
newRow = $("#"+blankRowID,$tableBody).clone().appendTo($tableBody).attr("class",newClasses).removeAttr("id").show().find("td div").slideDown(rowSpeed,function(){
-
//run this once animations finish
-
showHideSubmit();
-
});
-
//Add click event to the remove button on the newly added row
-
newRow.find(".removeRow").click(function(){
-
thisRow = $(this).parents("tr");
-
rowRemoved=false;
-
newRowCount--;
-
//animate the row
-
thisRow.find("td div").slideUp(rowSpeed,function(){
-
//this is run once the animation completes
-
if(!rowRemoved){ //this only lets it fire once per row
-
thisRow.remove();
-
showHideSubmit();
-
//make sure alternating rows are correct once a row is removed
-
$tableBody.find("tr:odd").removeClass(evenRowClass).addClass(oddRowClass); //odd rows have an odd class
-
$tableBody.find("tr:even").removeClass(oddRowClass).addClass(evenRowClass);//even rows have an even class
-
if(newRowCount < maxRows){
-
$addRowBtn.removeAttr("disabled");//re-enable the add button
-
}
-
}
-
rowRemoved=true;
-
});
-
return false; //kill the browser default action
-
});
-
}
-
//disable button so you know you've reached the max
-
if(newRowCount >= maxRows){
-
$addRowBtn.attr("disabled","disabled");//set the "disabled" property on the button
-
}
-
return false; //kill the browser default action
-
});
-
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-
-
-
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
//Click the remove all button
-
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
$removeAllBtn.click(function(){
-
//Close all the newly created rows
-
$tableBody.find("tr."+newRowClass+"").each(function(){
-
newRowCount--;
-
showHideSubmit();
-
//this happens once for every div that slides - no harm done though
-
$(this).find("td div").slideUp(rowSpeed,function(){
-
$(this).parents("."+newRowClass).remove(); //remove this row
-
$addRowBtn.removeAttr("disabled"); //re-enable the add button
-
});
-
});
-
return false;
-
});
-
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-
-
-
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
//Function to show or hide the submit/cancel buttons
-
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
function showHideSubmit(){
-
if(newRowCount > 0 && !displaySubmit){
-
//at least one new row is visible, show the hidden controls
-
$hiddenControls.fadeIn(rowSpeed);
-
//partially fade out all rows that are not new and disable links within
-
$tableBody.find("tr:not(#"+blankRowID+", ."+newRowClass+")").fadeTo(rowSpeed,0.25, function(){
-
$(this).find("a").click(function(){return false;});//makes all clicked links go nowhere
-
});
-
displaySubmit= true;
-
}else if(newRowCount <= 0){
-
//no new rows are shown, hide the controls
-
$hiddenControls.fadeOut(rowSpeed);
-
//fade old rows back in and re-enable links
-
$tableBody.find("tr:not(#"+blankRowID+", ."+newRowClass+")").fadeTo(rowSpeed,1,function(){
-
$(this).find("a").unbind("click");//removes the click event we site above
-
});
-
newRowCount=0;//Make sure the count is reset to 0...just in case
-
displaySubmit= false;
-
}
-
}
-
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
});
Thanks in advanced!
1 1578
It is pretty hard to study this code and reply you,
you better ask specific question
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: TrvlOrm |
last post by:
Can any one please help me...I am new to JavaScript and I have been
struggling with this code for days now and can't figure it out.
I would like to get the Buttons to correspond with the action to
either a) generate numbers b) Prompts a user to locate a web page c)
go to previous page in history list d) Loads next page in history list
e) Promps the user for a URL and loads the web page in a new window f)
and Re-Sizes the window.
...
|
by: SimonZ |
last post by:
How can you call function from aspx page?
For example:
button on aspx page:
<asp:button Visible="<% =funcVisible()%>" id="btnNew"
Runat="server"></asp:button>
code behind function:
|
by: hanseymoon |
last post by:
Dear newsgroup:
I've got this long function, which works good overall to spell check
words from a dictionary and I am not in a position to replace it. Can
someone please see where or how it might be chopping up words like:
don't. It brings them back as: 't, chopping off the "don" before the
apostrophe. I've looked over the whole situation and ran many $string
tests....and it appears to be narrowed it down to this. I may be wrong
and...
|
by: papalazarou78 |
last post by:
Hi
I've been experiementing with actionscripting transitions between sections... this is the first site I have tried this with (last 3 had swf loaded in one after another rather than transitioned between). I used some code from kirupa.com which works for loading movies in and out, but I also have some code for my movie buttons. I can get one or the other working, but not together, so I guess I'm clashing code somewhere, I could do with some...
|
by: mevima |
last post by:
I have a small form page, with a submit button and an onclick event.
<input type="button" value="Sign Up!" onClick="signUp();">
This worked just fine until I added a new regex function, but now it returns an "Error: Object expected" when I click it. I've tried moving the javascript function to the top of the page (inside the head tags) instead of the bottom (above the body tag, both above and below the form tag), all with the same error...
| |
by: rahulnag22 |
last post by:
I have created a button widget with a button click binding. The button
initially has a state=disabled. I can see the greyed out version of
the button in the GUI. But If I click on the button it still invokes
the callback/binding function.
Any suggestions as to why the callback is being invoked even though
the button has a disabled state. It looks like-
b=Button(frame, text = "Button", state = 'disabled')
|
by: femtox77 |
last post by:
Hi, I try to show or hide a button when I click on checkboxes. I
explain better. I'm learnig to use Jquery framework. I have a page
with many rows and every row has a checkbox. I wanna show a button
only when i check checkboxes. So I can show the button on every click
but when i "reclick" to uncheck the checkboxes the button goes away.
Any idea?
Thank you
Fem
|
by: souporpower |
last post by:
Hello All
I am trying to activate a link using Jquery. Here is my code;
<html>
<head>
<script type="text/javascript" src="../../resources/js/
jquery-1.2.6.js"</script>
<script language="javascript" type="text/javascript">
|
by: Haitashi |
last post by:
I have a form that calls a function using the onClick event in the submit button. I would like this function to return false if the username is taken. The the original function, which I've tested, returns the correct info when the "checkUname" button is clicked. However, it always returns false. I want to return false ONLY if the username is taken.
Original:
$("#checkUname").click(function(){
var datastring=...
|
by: thatcollegeguy |
last post by:
http://smarterfootball.com/exits/theHTML.html
I am not sure what is wrong w/ this code. The main issue is that the table that is in the initial html will empty its td but the table that I load using php and jquery through a mysql database will not empty the td elements. There is a table underneath the button in the initial html. if you click on a box in the table, it will empty. the same does not happen for the table that is generated by...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |