Hi php gurus, hope you can help me with a little problem i have encountered.
Basically i have a php generated page that can update multiple records within a mysql database (creates one big form in a table and uses arrays to submit changes back to database), this is used for updating targets for sales reps within our company.
However at the end of each line in the table (ie one for each sales rep) i want a button that can open a small pop-up that extra adjustments to the target can be made. This window is independent of the main window and will not affect the figures on the first page. Only thing is that it needs two php variables passed from the first form ($rep_name & $period).
Normally i would use a simple form submit button with the two variables as hidden input types. but because one of these hidden forms are nested within a bigger form it confuses the main form functions.
Can anyone give me some idea how to create a button (assuming it is possible of course) that can open a popup window (preferably of a set size) and pass variables to it like a form POST function does, but does not use any form html commands.
Any help would be massively appreciated
Obviously code can be posted if needed
Forms within forms (ish)
Moderator: General Moderators
Re: Forms within forms (ish)
I have actually just done something like this quite recently. I used a CSS popup instead of a new window popup. That way all the info is contained within one webpage.
First your button will not be a submit button but a regular old button(<button> or <input type='button'>). Attached to this button will be some sort of javascript that will append to the DOM the extra input fields that you need. If you place these in a div you can float them wherever you want. You can just add them next to the button or generate a CSS popup.
Here is a CSS popup example: http://www.pat-burt.com/web-development ... ew-window/
Make sense?
First your button will not be a submit button but a regular old button(<button> or <input type='button'>). Attached to this button will be some sort of javascript that will append to the DOM the extra input fields that you need. If you place these in a div you can float them wherever you want. You can just add them next to the button or generate a CSS popup.
Here is a CSS popup example: http://www.pat-burt.com/web-development ... ew-window/
Make sense?
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Forms within forms (ish)
You can also use a button with an onclick() or just an image wrapped in a link and append your vars as a query string.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: Forms within forms (ish)
Cheers guys, bit new to this php malarky so didn't know about the onmouse click thing, never though about the css pop-up will definitely look into that as well.