Dear All,
I have my link http://183.78.169.53/tm/layout.php. Basically I have two buttons one Add Single and one Add Double. When I press Add Single I want to have a new row with the single drop down list. On the other hand when I press the Add Double I want to have a new row with the two drop down list. How to achieve this any help please?
newbie14
0
Posting Pro
Recommended Answers
Jump to PostYou will need to set an event that fires when each button is clicked. You should give your buttons id attributes in their HTML tags.
In the javascript, make a function that, depending on the id of the button that was clicked, appends the HTML for a new row …
Jump to PostThen there's some decisions to make here.
One thing you could do is add the rows locally (on the client side) and then once everything is complete, have another button (eg. "Save") that actually submits the form and saves the data to mysql.
Another solution(which would be a …
Jump to PostAnother solution(which would be a bit more advanced) would be to incorporate some Ajax functionality into your existing buttons, so that when they're clicked they make a call to a PHP script that saves the current form data to mysql, and then when it calls back successfully, you go ahead …
Jump to PostI think you need something as simple as this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="
Jump to PostTy,
It's generally considered "good practice" to attach event handlers in javascript but this needs some explanation.
The problem with
onclick="whatever();"
is that whatever would have to be a function in the global namespace; it would be out of scope inside another function, whether or not that other …
All 24 Replies
TySkby
41
Junior Poster
newbie14
0
Posting Pro
TySkby
41
Junior Poster
newbie14
0
Posting Pro
Airshow
416
WiFi Lounge Lizard
Team Colleague
newbie14
0
Posting Pro
Airshow
416
WiFi Lounge Lizard
Team Colleague
TySkby
commented:
Nice example
+4
newbie14
0
Posting Pro
Airshow
416
WiFi Lounge Lizard
Team Colleague
newbie14
0
Posting Pro
Airshow
416
WiFi Lounge Lizard
Team Colleague
newbie14
0
Posting Pro
Troy III
272
Posting Pro
newbie14
0
Posting Pro
Troy III
272
Posting Pro
newbie14
0
Posting Pro
Airshow
416
WiFi Lounge Lizard
Team Colleague
newbie14
0
Posting Pro
TySkby
41
Junior Poster
Airshow
416
WiFi Lounge Lizard
Team Colleague
TySkby
41
Junior Poster
newbie14
0
Posting Pro
Airshow
416
WiFi Lounge Lizard
Team Colleague
Troy III
272
Posting Pro
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.