Jump to content


Form Element - Event Trigger

  • Please log in to reply
5 replies to this topic

#1 lokeshm

  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 21 May 2006 - 07:39 AM


1. I am creating a "Service Call Register" Form which Customer Info as well as "Problem Reported Details".
2. I have maintained Customer Info in "Customer Master" Table.
3. In the Form I have provided a Combo Box to fill in Customer Name,
4. Combo Box Values are populated from Customer Master Table.

Unitll here every thing works fine.
My next step is - The moment user selects a customer in Combo Box,
The same form should fetch and display Customer Address, Phone Numbers and Contact Person.
And the user continues entering "Problem Reported Details".

Is it possible to do in PHP.
If Yes, Please tell me how.


#2 Barand

  • Moderators
  • Sen . ( ile || sei )
  • 18,015 posts

Posted 21 May 2006 - 08:02 AM

Best way is to use [a href=\"http://members.aol.com/barryaandrew/xmlhttp/article.html\" target=\"_blank\"]xmlhttp request[/a]
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received


|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#3 .josh

  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 21 May 2006 - 08:46 AM

translation: no, it is not possible with php alone. php is a server side language. you will need to look into ajax to do that (which is the part barand said).
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#4 lokeshm

  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 23 May 2006 - 02:08 PM

Dear Barand and Crayon

My Special Thanks to you both....
Barand I implemented the concept you have suggested and also used the xmlhttp.js file.
Barand, "Service Call Registration" is the first application I have worked on using PHP I am so much eager to show this application to you. I am very happy, it worked the way I wanted, Moreover it is extreemly fast.

I wont be able to thank you both enough.
Thanks again.


#5 appeland

  • Members
  • PipPipPip
  • Advanced Member
  • 30 posts

Posted 23 May 2006 - 05:46 PM

make one form for the combobox alone(you can still leave the rest of the form there, we just change the target and move the </form> tag later), assign a javascript onchange event to it to
submit the form once the customer has been choosen (I guess the value of the combobox options will be some kind of customer unique id = uid).
That form will point to itself basically, except that it now knows the uid of the previously choosen

In the form you have to do an if/else statement checking if the uid is there.
if it is it will change the forms target and not set the </form> for the previous "little" form that only choose the customer.
It also does not display the combobox anymore, but rather does a quick query to your Db to get the full customer details and displays them nicely formatted.

Good luck.

#6 lokeshm

  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 25 May 2006 - 11:14 AM

Thanks Andi

You too have another way around as a solution for my question.
I shall try and see how your suggestion works out.
Way to learn from all of you people

Thanks Andi
Thank you all


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users