| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Regular Join Date: Jul 2005 Location: United States
Posts: 586
![]() ![]() ![]() ![]() | form push button to remove info from db Hey everyone. I am building a form right now that has 1 input field - email address. Basically, the form will allow users to add their email addresses into a database, so that they can receive electronic newsletters. What I want to do is include a 2nd button beside the "submit" button that will alow a user to remove his or her email address from the db as well. I figure that using a "push button" is the way I need to go, and that I need to create some function that will get the email address in the email address input field, and "post" that by refreshing the page which will activate my PHP script that will recognize the email address is to be removed from the database, and which will do it. ????: NamePros.com http://www.namepros.com/programming/178203-form-push-button-remove-info-db.html That's what I think needs to happen. Any idea on how this is actually done?? Here's what I'm thinking what to do in my html: Code: <input type="button" value="Remove Your Address" ONCLICK="window.location.href='newsletter.php?remove'"> Thanks, David
__________________ Smooth Stone Services Affordable Web Hosting Solutions Starting at only $4.95/month, IT Consulting and Technical Support Hunt Sources - Hunting Resources Online |
| |
| | #2 (permalink) |
| New Member Join Date: Mar 2006
Posts: 5
![]() | I'm not sure if that would work but you can try it. I've used this method before and I think it might work for you too: In your form: Code: <form action="newsletter.php"> <input type="submit" name="newsletter" value="Add Your Address"> <input type="submit" name="newsletter" value="Remove Your Address"> ????: NamePros.com http://www.namepros.com/showthread.php?t=178203 PHP Code: |
| |
| | #3 (permalink) |
| NamePros Member Join Date: Oct 2005
Posts: 27
![]() | you can also do Code: <input type='button' value='Remove Your Address' ONCLICK="window.location.href='newsletter.php?remove=T&sEmail='+document.formname.fieldname.value;"> neeto! yey! whohoo! *backflips* ...you can copy the code (not like I can stop you, nor do you have my permission -- or ANY of you dingdongs!) on the client side, but not the server side...nah nah nah |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Transforming a Form button into Normal button | dima777 | Website Development | 4 | 11-08-2005 10:40 PM |
| NEW : Google AdSense(TM) Online Standard Terms and Conditions | Mark | Google Adsense | 3 | 11-04-2005 01:37 PM |
| $75 Contest For HTML Layout Compelling FORM | btrader | Design Contests | 17 | 09-10-2005 08:01 AM |
| changing button colors in form | lovelylovely | Web Design Discussion | 6 | 05-15-2005 11:37 AM |
| php contact form wioth submit button | TWM | Programming | 2 | 11-11-2003 11:20 AM |