473,500 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Autofill data from a php form...

So I have this form I created in PHP, to get a general estimate of the
cost of my product... right now i have it so whatever you select, be
it in a dropdown menu or checkbox, your total is displayed at the
bottom, in textboxes, by clicking submit. I'd like it so the form
dynamically changes these totals depending on the value of the
dropdowns/checkboxes so I can remove the submit button completely if
that makes any sense... anybody have any suggestions, or is there a
tutorial out there that shows how to do this?

Thanks
truck
Dec 17 '07 #1
4 1815
On Dec 17, 2:17 pm, Truck Estevez <oohtr...@gmail.comwrote:
So I have this form I created in PHP, to get a general estimate of the
cost of my product... right now i have it so whatever you select, be
it in a dropdown menu or checkbox, your total is displayed at the
bottom, in textboxes, by clicking submit. I'd like it so the form
dynamically changes these totals depending on the value of the
dropdowns/checkboxes so I can remove the submit button completely if
that makes any sense... anybody have any suggestions, or is there a
tutorial out there that shows how to do this?

Thanks
truck
Can you paste the code?

To point you in the right direction, you will have to use events of
the input and select elements.
Dec 17 '07 #2
Truck Estevez wrote:
OK this is going to be long, sorry.
No.
[more than 800 lines of uncommented code]
[top post]
http://jibbering.com/faq/
PointedEars
Dec 18 '07 #3
VK
On Dec 18, 10:09 pm, Truck Estevez <oohtr...@gmail.comwrote:
Right, thats a great example but I have php doing all my calculations
and I really don't want to re-write the whole thing in javascript...
am I screwed or is there a way to integrate my php calculations with
the js?
You did not say that you want to make any PHP integrations. All you
said was "I'd like it so the form dynamically changes these totals
depending on the value of the dropdowns/checkboxes", that is what this
nice sample by Bart Van der Donck is about. For the quoted question
yes, you are kind of screwed because PHP is run server-side and
Javascript is run client-side and they have no native runtime
connection whatsoever. You may of course attach event listeners to
form elements and onchange use XMLHttpRequest to the server to get the
calculation result so to update relevant form fields (kind of RMI/
WebService path). But if it's nothing than simple cost/total/tax etc.
calculations then such approach is hugely ineffective IMO. Just use
Javascript alone. Other option is to keep everything server-side and
provide "Recalculate total" or similar submit button in the form to re-
submit the form every time user wants to see the results of her
selections. You also may use Javascript solution for automated updates
client-side and normally hidden <noscriptblock with "Recalculate
total" or similar submit button in case if the script support is
disabled.
Dec 18 '07 #4
Truck Estevez wrote:
On Dec 18, 8:02 am, Bart Van der Donck<b...@nijlen.comwrote:
[snip code]
Right, thats a great example but I have php doing all my calculations
and I really don't want to re-write the whole thing in javascript...
am I screwed or is there a way to integrate my php calculations with
the js?
I'm afraid that the PHP-code cannot be ported. You'll need to write it
from scratch in javascript. But frankly, I don't see what could be
wrong with doing it in PHP.

--
Bart
Dec 19 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3464
by: Chris Sharman | last post by:
I'd like to design my pages to work cooperatively with browser autofill features. I've loked around, but can't find any good documentation on supported/unsupported field names...
1
18513
by: shortbackandsides.no | last post by:
I'm having a lot of difficulty trying to persuade the Google toolbar autofill to act consistently, for example ======================= <html><head> <title>autofill test</title> </head><body>...
0
4246
by: David Portabella | last post by:
Hello, I am a doing a survey about Autofill Web Forms softwares. Usually, they all collect information of the user once during the set-up phase (user knowledge base). Then, when the user...
0
2288
by: Ray Holtz | last post by:
Is it possible to autofill a field based on what is entered into another field in a form? My form has an employee field, and department field. In an Items Table, I have fields FldEmployee, and...
1
2107
by: Nick J | last post by:
Hi, I remember at one point access would autofill a text box when filtering by form, Like for example as I would type it would come up with matching records, similar to AutoComplete in Internet...
4
15828
by: HTS | last post by:
I have written a membership database application (PHP + mySQL) and need to prevent autofill from filling in fields in a member record edit form. I know I can turn off autoFill in my browsers, I...
0
2040
by: Randy | last post by:
Hi, I have some comboboxes that are created dynamically at run time based on user actions. I found a procedure on a message board to autofill the combobox text from the dataview that the...
2
1530
coolgames
by: coolgames | last post by:
Where does internet explorer store autofill and website *form* data by the *form*, i mean in the address box where the websites popup. thank you
1
1971
by: berlich | last post by:
Can I use visual basic.net to access the DOM in a web page so that I can autofill the text boxes? If so, can you point me in the right direction as to where to begin? I need to fill in a lengthy...
1
3141
by: Nik Coughlin | last post by:
I'm doing some ajax validation on form fields, using the form change event. If I click Autofill in the Google Toolbar, fields are filled out but the change event is never fired, so the validation...
0
7136
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7018
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...
0
7182
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7232
jinu1996
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...
1
6906
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...
0
7397
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4611
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3106
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
316
bsmnconsultancy
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.