Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Having Trouble With Form Buttons:


Trying to use an image as a button in a form and although it looks good in dremweaver, when i upload it the picture appears inside a regular button. Code:

<button class="mult_submit" type="Submit" name="Submit" value="<?=$count;?>" title="Delete">
<img src="images/delete.gif" title="Delete" alt="Delete" height="20" width="20">
</button>




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
PHP And Form Buttons
i display the content of a mysql table in a HTML table and the users selects a record by clicking a checkbox wich is available for each record .and at the bottom of the page i want to have 3 buttons ADD, EDIT, DELETE ... how i can do that with php ... if it's possible to use plain buttons like <input name = "button1" Type="BUTTON" Value="ADD">

Form Buttons And Prev/next
Can form buttons be used in prev/next pages? I've been at this a while and can't seem to get it. You can see what I'm trying to do here . As you can see the text link works fine but the form buttons well you get the idea.

Form With Two Submit Buttons
how i can have one form with two submit buttons to perform different action ie add or delete "javascript:window.document.addfiles.submit()" each button has this javascript on it can i put for example 'delete' in the brackets and then pick up in my php whether 'delete' or 'add' was sent through the submit?

2 Submit Buttons In One Form...is It Possible?
I built a working form script that emails me the information the user entered in a css styled form. As well as a send button, I would like to have a print button, that instead of emailing me the information entered, it pulls the same result form that would be emailed to me, in a new window so that the user can view the result and then print it.

Is this even possible? And if not, what are my alternatives? As far as I know, only the submit button collects the data in the fields and puts it into the php variables and then does something with the results.

Submit And Preview Buttons On A Form
I am trying to do a little script that users can post news but before they click Submit they can click a Preview button (same as in this forum where you can preview your post before posting it)

How do I do it!!! I have tried for ages to work out how its achieved as I am sure its fairly simple.

Form With Multiple Submit Buttons
Ive been trying to figure something out for a bit and im a little stuck on it.

I have a page with a form that on-submission passes the values of 2 hidden fields to the next page. Now however, I want to give the user a choice between 2 pages to go to, but im having trouble finding a way to pass the hidden fields to either of the 2 pages.

Right now im trying to use 2 submit buttons to do this, each one linkining to one of the 2 possible pages. Then I use the code:

Delete Buttons On Form Not Working
i have the following script at the top of the page and the form below on that same page. it works in Safari and FireFox on both PC and Mac. However, in IE the page just reloads and nothing gets deleted. Any suggestions? Code:

Adding Checkboxes Or Radio Buttons To A Form
Is there a tutorial out there that anyone could send me a link to that uses checkboxes or radio buttons in an email form?

Multiple Submit Buttons In Dynamically Generated Form
I have one big form on a page, within which is a list of text fields pulled from a mysql db. Each text field has an 'update' button, which submits the main form, and should UPDATE the textfield it relates to.

The problem is, all the buttons have value="Update" and I can't think of an efficient way of passing the unique id of each record to be submitted with it. Obviously, having a hidden field for each textfield won't work because the form will use the last one displayed.

Multiple Submit Buttons On Shopping Cart Form
I am using an SQL query to populate a table with product data.  The form is processed by another file.  The buttons after each item are SUBMIT buttons.  I want to have the user click the appropriate button and it sends that particular items ID value on for processing.  The only way I found to do that is to have the submit button's value be the ID; which of course displays that ID instead of a "Proceed to Checkout >" label.  I have tried a HIDDEN value inside my FOREACH loop but it returns EVERY ID not a particular one. 

How To Create List Of People With Yes/No Radio Buttons For Each, Then Process Form
I have a database result set with names, IDfield and a Y/N field.

How do I create the radio buttons that can then be processed easily using an
array (I assume) with an easy-to-loop-through structure?

The form would look like:

Joe Smith O[Y] O[N]
Karen Smith O[Y] O[N]
....

Trouble With Mailing A Form Submission
I recently had to move all my php pages and MySQL db to a new server and may have overlooked a setting or two in the php.ini or somewhere else. This form worked up until the move. Here's the code:

Trouble Passing Variable To Prcoess Form..
I trying to develop a simple league based system, whereas you select from a drop down list the teams that are playing, then you enter the scores of the selected teams.

I have created the form which shows the teams in the drop down list and also contains fields so that you can enter the score for each team. Now, the problem I am having is actually processing this data.

When you select the teams and enter the scores, I have it set so that these variables get passed to process.php which should calculate the scores and enter this into my Div2Table database. I cannot seem to get process.php to work. I am not passing the variables over correctly. Here is the initial form that allows you to select the teams and enter the scores: PHP Code:

Trouble Passing Form Input To C Program
I'm using exec to start a C program and need to pass it some parameters from a form. It works fine if I hard code sample parameters into the exec call like so:

exec('/var/www/argtest 2000 March', $output , $returnStatus);
With the following, the C program runs but the parameters do not get passed:
exec('/var/www/argtest $year $month', $output , $returnStatus);

I searched the forum and found an entry indicating that I should be able to include those variables like that. What am I doing wrong here?

3 Buttons
I would like to create 3 buttons that perform the following:

button1: Click to access Yahoo
button2: Click to access bn.com
button3: Click to access dell.com

This can be done using asp, HTML, and JavaScript. I am relatively new to PHP and don't know how to make it work using PHP.

Submit Buttons
Just installed apache 1.3, and php4 on a freebsd box. was playing around with phpweblog to look at some themes and get ideas for a layout but cant seem to get past the setup.

The problem is that it makes me set a pass, when i put in the pass and click on the submit button, nothing happens. I think I had this problem before with a submit button on a form before but thought it was something else .

IF And Radio Buttons
I have the following code which connects to a database and sets the
value of counter to &#390;' and the date to be either the current date or a
users own date. The database connects via an included script as this is
a contribution for OSCommerce. Each section (the set date today and set
date custom) works fine by itself (with the other half commented out)
but I cant make it so the option is available via radio buttons, what am
I doing wrong?

P.S. This is the code I am using

<?php
include('includes/application_top.php');
?>
<html>
<body>
<?php
//OS Commerce Counter Reset v0.15
//Author: Ben Allen

if ($submit) {
//Validation
$flag="OK"; // This is the flag and we set it to OK
$msg=""; // Initializing the message to hold the error messages
//Set Query Variables
$query = "UPDATE counter SET counter = 0";
$today = date("Ymd");
$datetoday = "UPDATE counter SET startdate = $today";
//Set Date=Today
if ($setdate="true") {
$counterquery = mysql_query($query);
$datequery = mysql_query($datetoday);
echo "Counter Reset Succesfully";
}else{
//Set Date Custom
if ($setdate="false") {
//Edit Database:
$customdate = mktime(0, 0, 0, $month, $day, $year);
$datecustom = strftime("%Y%m%d", $customdate);
$datecustomquery = "UPDATE counter SET startdate = $datecustom";
$counterquery = mysql_query($query);
$datecustomresult = mysql_query($datecustomquery);
echo "Counter Reset Succesfully";...........

Previous/Next Buttons With Txt?
On my pages I always have a previous button and a next button. The files are put in order.
like this:

index.php
preface.php
plants.php
animals.php
. . . . . . . . . <-- dogs.php
sheeps.php
the-end.php

with the previous/next buttons they are linked among. If I add a page (dogs.php) I will have to change the buttons of two pages (animals.php, sheeps.php). Wouldn't it be possible to define the order of the files in a seperated file (like txt)?

Radio Buttons
I'm using the code :

if (!isset($rSemester)){
$valid = "false";

$error_message .= "* Please choose at least one semester <br>" ;} rsemester is two radio buttons. why does this not check properly. am I missing any thing.


Radio Buttons
I am trying to make a poll, but I can't get it to work at all. I'm trying to, when the user clicks on the radio button, add 1 to the total for the one they clicked on.

Radio Buttons
I have a page which displays lots of input fields, text areas and radio buttons. When the submit button is pressed, a short bit of error checking happens, and if the form is not correct, the user is returned to it.

When returned, all the fields etc will contain the previously entered data so that the user can see where they went wrong. This is all well and good, except I can't see how to do this with the radio buttons - a/ is it possible, b/ how easy is it to do c/ suggestions on solutions? PHP Code:

Submit Buttons Using Php
I'm new to using php coding. I need help with the following:
1. There is a submit button on the form and is saves information to
my database. After clicking on "Save Measurement" it redirects me to
another page in my site.

What I would like to do is change what page directs it to. Currently
the submit button redirects me to page /measure/men_measure. I would
like to be able to change this.
Please see below my page below:
<?php
include("../lib/BaseFile.php");
misc_navigation('measure/take_measure.php');
misc_auth('User_Measuring');

$query = "select * from ".DB_TABLE_PREFIX."_mes_men where user_id = ".
$_SESSION['auth']['user_id'];
$result = mysql_query($query) or die ("could not send query3");
$row = mysql_fetch_assoc($result);

foreach($row as $key =$value) {
$info[$key][$value] = " checked ";
}

if (!empty($_POST)) {
$query = "update ".DB_TABLE_PREFIX."_mes_men set ";
$first = true;
foreach($_POST as $key =$value)
{
$keys = explode('_',$key);
unset($keys[0]);
$key = implode('_',$keys);
if (!$first)
{
$query .=",".$key."='".$value."'";
}
else
{
$query .=$key."='".$value."'";
$first = false;
}

}
$query.=', filled6=1 where user_id='.$_SESSION['auth']['user_id'];
mysql_query($query) or die(mysql_error());

// update profile
$sql = "UPDATE " . DB_TABLE_PREFIX . "_user SET other=1 WHERE
user_id = " . $_SESSION['auth']['user_id'];
mysql_query($sql) or die(mysql_error());


Radio Buttons
All I want is a very simple form with 2 radio buttons and a Next button.
Whichever button they choose will determine which page will appear next.
I've looked everywhere and tried several things but for some reason it just wont work!

Radio Buttons
I am having  an issue showing all of my radio buttons in php. I want it to read all of the different options from the database and put them all as Radio Buttons.. I can do it with a list but not with the bottons. Code:

Radio Buttons
I am trying to change the value in table with radio buttons. If one radio button is selected it changes the value in the field to 'y' and if the other is selected it changes the field to 'n'.

So first of all I need to bring back the values from the table and have the correct radio box selected, then I need to be able to update it. also both cannot be selected at the same time (which I why i think i'm supposed to use radio buttons). Code:

Radio Buttons
I am trying to change the value in table with radio buttons. If one radio button is selected it changes the value in the field to 'y' and if the other is selected it changes the field to 'n'.

So first of all I need to bring back the values from the table and have the correct radio box selected, then I need to be able to update it. also both cannot be selected at the same time (which I why i think i'm supposed to use radio buttons). currently...

<input type="text" name="umobile" value="'.$value[7].'" />

That brings back the letter 'y' which for me means yes. and of course 'n' means no.

Different Actions With Different Buttons
I'm just starting to learn PHP, and I'm tinkering around with making some pages myself.  I would like to make a page with two form buttons that can do two different things, say, clicking one creates a new entry in a database and clicking another lists all the data currently in the database (These actions could be anything for example's sake).

I've gone through the w3schools PHP tutorial and have poked around on other PHP sites, but I can't seem to find how to do this.  In javascript I can simply write a function() and then have the onclick of the button call the function, but no luck with PHP.

How do I do this, and where can I go to find some tutorials that will give me a better understanding of having different buttons do different things? 

Calendar Buttons
I want to make a calendar button in order to choose a date in fact i want 2, date from and date to.

Radio Buttons
I have a long list of items, and beside each item, there's a radio box under several options. Players should be able to select ONE radio box for each item, and the item ID needs to be stored in the array delMsg[]. Here's my code:

Multiple Submit Buttons
I am just getting trouble in a form submission. I have two input box with values and after each one it has two submit button.
When i want to update it gives me the same value for all input boox. Check this code..

I m gettin same value when i click on update for any input box:

How To Use Multiple Submit Buttons?
I have a sort form that has two fields one to specify the row name and the data that you want to sort the database output by.
But when i input an alphanumeric letter like "X" it gives me an error:

Validate Radio Buttons
i am trying to create an PHP form that checks to see if a radio button as been selected before submitting information.

there are two radio buttons, and the user needs to pick one.

Checkboxes And Next/Prev Buttons
I am having this problem i cant understand it. I have been able to create this perfectly working script to output results from the database dynamicly. Each record has a check box next to it so i can select if i want to delete it. I am showing 20 records per page.

Here are the main problems :

1) The numbered pages are shown however the next / prev links that i have created are not outputted.

2) How can i make it delete the selected record/s after pressing submit which i tried to place but it isnt showing up for some reason :-s.

And this is a challenge / extra one for me at least :

3) How can i can i make it remember from one page to another what to delete ? shall i used session if so how to implement them ? Code:

Rod Kreisler's Next/prev Buttons
I found a updated version of Rod Kreisler's sample for next/prev buttons with MySQL results. The problem is that I want to use "&" in the URL, like: www.host.com/page.php3?id=users&show=20 This is the code:

Combining Submit Buttons
I now have 2 submit buttons on 1 HTML page, where 1 is used to Handle a File Upload (this finally works!!!), and another that is supposed to Submit comments into an Access Database. Basically, I need to know if their is a way that I can do both at the same time on the click of 1 button.

Images As Submit Buttons
I have been trying to replace Submit buttons on a form with images. For some reason it does not post the varables. What am I doing Wrong? Code:

Multiple Submit Buttons
I want to create a form with several submit buttons, i.e. button1 => do this and button2 => do that, how do i find out which button the user clicked on? PHP Code:

Using Submit Buttons With $_POST
I wondered if anyone could advise further? In my script I was trying
allow the user to enter a userid and password, and when the users
clicks the login button. Pass these values passed to a method
login_user, and finally display there record.

I was hoping to display the record on this web page. I would appreicate
some advice if my scrips looks correct? I unsure about the line
if(isset($_POST['login'])){?........

Radio Buttons And Forms
I have a form with a series of records, each with a radio button. It's probibly very obvious, but I can't seem to figure out how to get that number when processing the form.
I know it's an array, but it seems like radio buttons don't quite work like check boxes.

How To Use Radio Buttons To ID A Mysql Row
I've written a script that displays a list of names and puts a radio button next to the name. The idea is that a user can select the name and then press one of two buttons: delete or edit. A third add button with a text field would be available as well.

I'm having difficulty figuring out how to use the radio button's value to send a delete query. Here's what I have so far, and it is the last section --if($submit)--that doesn't work for me:

Dynamic 'Next' And 'Previous' Buttons
I am working on a project that uses dynamic buttons to navigate
through search results. The way it is set up right now, the buttons
work perfect, as long as the user doesn't use the broswer's back
button. Here's how the buttons work:

They are javascript buttons that use a php session variable to set
where they should navigate to. This said, once the button is
clicked, the php session variable is then updated to reflect the new
base record number. Something like:

$SESSION[0][BASE]=$SESSION[0][BASE]+10;

Now, this works great, unless the user hits the back button on the
browser, because the session variable doesn't reload it's previous
value. So, if the base value had been 20 on the new page, and the
person clicks 'back' on their browser, the value remains 20. What it
does it creates a situation where the person might have went back to
the page that shows records 1-10 of 25, but when he/she clicks the
next button, it's now going to take him/her to the page for records
20-25. If they click the browser's back button again, they will once
again arrive at records 1-10, but if they click the next button
again, it will take them to a blank page showing records 30-25 of
25... etc..

Is there a way in php to detect the back button being used on the
browser? If not, how can I do a check to override the new session
variable?

Radio Buttons And Use Of NULL
I am developing a survey that has a bunch of mainly radio buttons. The radio buttons are for selections Disagree Strongly through Agree Strongly which I have assigned values 1-5, and a N/A selection. If nothing is entered, or N/A is selected, I want NULL to be entered into the DB. For more information on this, read this thread: Here is the code:

PHP Dynamic Submit Buttons
I am creating a php page that when you submit 'get''s data to another page. The problem is that for each row I want a different submit button that will submit criteria specific to that row. The problem is that each submit button that is made follows the last made hidden input from that particular row. Basically what I am trying to do is make it to where which ever row I submit, will 'get' two fields from that record. I would post source code, but I don't think that would clear up anything.

Basically in short I have two different fields in each record (keys) to identify of each record. I have to reference through these fields, since there is no other way. Unfortunately, when you load the page, the way the page is written it remakes each hidden input after each record. Doing this it simply sets the ($row[field]) to the last one in the query, no matter which record you submit. Make any sense?

2 Submit Buttons On 1 Page
I have this code :

<INPUT TYPE="Submit" VALUE="Change Password" name="ChangePasswd" TABINDEX=4>
<INPUT TYPE="Submit" VALUE="Login" name="action" TABINDEX=3>

Problem : When the enter is pressed, the first submit is executed. -> "Change Password". I want that when enter is pressed that the "Login" button is triggered.

Is there a possibility to set the enter to "Login" without changing the the place of the buttons??? (if I put "Login" button before "Change Password"; Enter does the "Login", but this is no option)

Using Buttons To Store Variables
I'm writing a PHP script, and I know exactly how I want it to work, and what I want it to do when certain things happen. I also know how to make everything work. Well, everything except for this!

The goal of the application is to perform sales.  It will use a point and click interface. It should look something like this:

item 1

How To Code Add,find,delete Buttons
Hello, I am new to PHP and Postgres. I am creating a page that displays a form to allow entry of details about a piece of equipment. The form is intially blank. I want to have 3 buttons: Add, Find, Delete. It shows only one piece of eqipment at a time.

The user can fill the form out, press Add and it will insert into the database. Or they can enter the equipment ID, click Find and then modify or delete (by pressing the Delete button) the returned record.

I am able to create the form and the SQL but I am not sure how to have the buttons fire to execute the PHP code for each functionality (Insert, Find, Delete, Update).

Can someone point me to a resource that shows how to do this?

Stuck On Next / Previous Article Buttons
Okay, heres the situation. I have about 1,000 rows of articles in a MySQL database. Bad part, they were not inserted in the order that they appear. So for example:

1 | How To Program PHP | 4/20/2000
2 | Discovering Java | 8/15/1998
3 | Take Up Yoga | 4/19/2000

The first column is the ID, the second the title of the article, the third the date. In Cold Fusion I managed to do a SQL statement that got the ID's of the articles and put them in chronlogical order for me. Making the articles list like so:

Making Radio Buttons Sticky
My new form challenge I'm facing is preserving my checked radio buttons after form validation and, checking the appropriate button when information is retrieved from mysql dB.

I (with lots of help) was able to get all of the above working for an array of checkboxes but, I cannot use the same method for the radio buttons (I was able to call and display them dynamically but, that didn't seem to help. Here's the code I'm strugling with:

<label>( National Touring
<input type="radio" name="touring" value="National Touring"></label>)
&nbsp;
<label>( Regional Touring
<input type="radio" name="touring" value="Regional Touring"></label>)
&nbsp;
<label>( Market-based
<input type="radio" name="touring" value="Market-Based"></label>)
&nbsp;
<label>( Other
<input type="radio" name="touring" value="Other"></label>)

Can anybody teach me how this can be done?

Changing Radio Buttons To Dropdowns...
i need to change these radio buttons into dropdowns, can someone please get me started so i can see what needs to be done? PHP Code:


Copyright © 2005-08 www.BigResource.com, All rights reserved