Jump to content

PHP + JS (AJAX) + FORMS


miffe

Recommended Posts

Hi there,Got a quick question which is troubling me, I hope someone can answer it for me :)Lets say I have two different tables in a mysql db.... one is invoices and one is sales, each sale (item) is related to a different invoice...I want to build a PHP page which has two textboxes, one with invoice # and one with item number, below, the result of the script which uses AJAX will return me first of all when I enter a invoice number, the invoices starting with such numbers, say I introduce 2 it will return all those starting with that number into a table... when I enter the item number it will return me on the right in another column on the table the items (in all actual invoices) related to those invoices...Example, if I put '1' in invoices and '2A' in item #, it will returnall invoices starting with 1 and all sold items starting with 2A in each invoice starting with 1.I've got this in a PHP file:echo "<form action='nopage.php' method='post'>"; echo "Remisión: <input type='text' name='idRemision' STYLE='width: 146px' onkeyup='showUser(this.value)'> "; echo "Modelo: <input type='text' name='idModelo' value=''><br><br>"; echo "<span id='txtHint'>[Lista de Mercancía: Teclea un numero de folio]</span><br>";echo "</form>";Yes, this will then go on to a Javascript file which has a function that processes this.value as an invoice number, and goes on to another php file which extracts from the DB all invoices starting with this.value...This only takes into consideration the invoice number, I also want to introduce the other textbox in the form above... how can I send as a parameter the name of the form item 'idModelo'it's really confusing, I know nothing about JavaScript, and in this case it's an interaction between html forms, php, javascript and the AJAX method... A bit confusing =(help?Thanks =)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...