| | |
AJAX & PHP Help
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Aug 2004
Posts: 12
Reputation:
Solved Threads: 0
Was wondering if you could take a look at the attached code.
I have a form that is making a call back to the database and populating search form for parts. As you type in parts, it renders choices (screenshot2 attached). You can then click on a choice and it populates the text box and a button also renders.
You can actually test the script: <URL SNIPPED>
Start typing in "DS12" and then click on one, you will see what I mean (screenshot1 attached).
What I want to do is take the $_GET['id'] and the new part number in the form to another script, right now just putting it into an array. I have a javascript function that sets up the form, called setpartno:
product_search.php
I want to pass that Id and part number, as I stated above, to updatePartName(), you will see that below setpartno.
I do not know what to do with this part, I am a little lost. I was wondering if anyone could take a look at it. So I want to click on the button and pass that info ($_GET['id'] and partno (that has been selected) to the update.php script.
I do not know how to pass that in the updatePartName and I also do not know what code I need to do to submit the button, if any or is that code okay?
Man I hope this jibbersh makes sense
Thanks in Advance
~Mike
I have a form that is making a call back to the database and populating search form for parts. As you type in parts, it renders choices (screenshot2 attached). You can then click on a choice and it populates the text box and a button also renders.
You can actually test the script: <URL SNIPPED>
Start typing in "DS12" and then click on one, you will see what I mean (screenshot1 attached).
What I want to do is take the $_GET['id'] and the new part number in the form to another script, right now just putting it into an array. I have a javascript function that sets up the form, called setpartno:
product_search.php
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<?php echo '<pre>' . print_r($_GET, true) . '</pre>'; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <title></title> <style type="text/css"> /* ---------------------------- */ /* CUSTOMIZE AUTOSUGGEST STYLE */ #search-wrap input{width:400px; font-size:16px; color:#999999; padding:6px; border:solid 1px #999999;} #results{width:260px; border:solid 1px #DEDEDE; display:none;} #results ul, #results li{padding:0; margin:0; border:0; list-style:none;} #results li {border-top:solid 1px #DEDEDE;} #results li a{display:block; padding:4px; text-decoration:none; color:#000000; font-weight:bold;} #results li a small{display:block; text-decoration:none; color:#999999; font-weight:normal;} #results li a:hover{background:#FFFFCC;} #results ul {padding:6px;} </style> </head> <body> <h4>Your current Product for this opportunity is <?php echo $_GET['name']; ?></h4><!-- AJAX AUTOSUGGEST SCRIPT --> <script type="text/javascript" src="lib/ajax_framework.js"> </script> <div id="search-wrap"> <h2>Search for new product</h2><input name="search-q" id="search-q" type="text" onkeyup="javascript:autosuggest()"> <div id="results"></div> </div><script type="text/javascript"> function setpartno(partno) { document.getElementById('search-q').value = partno; var e = document.getElementById('results'); e.innerHTML='<input type=submit value="Change Part Number">'; //e.style.display="none"; } function updatePartName(){ nocache = Math.random(); http.open('get', 'lib/update.php?id='+q+'&partname = '+nocache); } </script> </body> </html>
I want to pass that Id and part number, as I stated above, to updatePartName(), you will see that below setpartno.
I do not know what to do with this part, I am a little lost. I was wondering if anyone could take a look at it. So I want to click on the button and pass that info ($_GET['id'] and partno (that has been selected) to the update.php script.
I do not know how to pass that in the updatePartName and I also do not know what code I need to do to submit the button, if any or is that code okay?
Man I hope this jibbersh makes sense
Thanks in Advance
~Mike
Last edited by peter_budo; Oct 27th, 2008 at 3:32 am. Reason: URL SNIPPED - user request
![]() |
Similar Threads
- Web Design & Development Company Hiring (Web Development Job Offers)
- need help for web chat using php & ajax (JavaScript / DHTML / AJAX)
- How to send & as data using _POST method using Ajax (PHP)
- Team of Developers & Designers (Post your Resume)
- AJAX & PHP Developer ( Full Time ) (Web Development Job Offers)
- Professional web-developer & architect for hire (Post your Resume)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Scriptaculous/Ajax help
- Next Thread: How to launch pop-up windows using Ajax?
Views: 852 | Replies: 0
| Thread Tools | Search this Thread |
Tag cloud for JavaScript / DHTML / AJAX
acid2 ajax ajaxexample ajaxjspservlets array automatically autoplay beta blackjack boarder box button captcha card cart codes column css date debugger decimal design developer dom download element embed enter error events firefox flash focus form frameworks gears getselection google gwt hiddenvalue hint html htmlform ie7 iframe index java javascript javascripthelp2020 javascripts jquery jsp libcurl listbox maps marquee masterpage media menu microsoft mimic mp4 offline onerror onmouseover parameters paypal php player position post problem programming prototype rating redirect safari scale scriptlets search security select size software sources starrating toggle tweet twitter unicode validation variables w3c web webkit webservice website window windowofwords xml





