473,320 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Help me to submit my form with javascript please

Hello.

I have a frames page that has a header, body and a footer. The header frame has an ajax autocomplete that returns a number and a string from a database.

Here is what happens. The user looks up a client in the autocomplete textbox. The ajax autocomplete give the user choices. the user selects the one he wants with either his mouse or the arrow keys and then presses ENT. THERE IS NO SUBMIT BUTTON.

The value that was returned by ajax needs to go to a php script where it will do a lookup by the customer number. The value returned by ajax is the customer's number.

This returned value is what I need help with. I need to get the returned ajax value into my query sting (GET) so I can populate the body frame with the correct info. I am having a really hard time with this and can't make any headway.

I know no javascript at all so please spell things out for me.

Here is the relavent code.

Expand|Select|Wrap|Line Numbers
  1. <form method="post" class="hdrForm" id="search" action="../../index.php?ds=2" target="_top">
  2. <input type="text" name="string" class="hdrInput" id="string" value=""><div id="acDiv"></div>
  3. </form>
  4.  
Expand|Select|Wrap|Line Numbers
  1. var AC = new Suggest('string','acDiv');
  2. AC.ajaxTarget = '../../lib/inc/suggest.php';
  3. AC.chooseFunc = function(id,label)
  4. {
  5.   document.forms.search.submit();
  6. }
  7.  
Thanks for any help you can provide.
Apr 2 '09 #1
2 1525
I have actually figured out most of this already but I am still having a problem.

Here are two functions. I need to use the "id" variable in the SubmitForm() function as well. Can someone please tell me how to do this? This is how new I am to js. :)

Thanks for the help.
Expand|Select|Wrap|Line Numbers
  1.   AC.chooseFunc = function(id,label)
  2.   {
  3.     document.qSearch.action = ".index.php?dc=2&id="+ id;
  4.     //document.qSearch.action = "index.php?dc=2";
  5.     document.qSearch.submit();
  6.   }
  7.  
  8.   *** This one fails.
  9.   function SubmitForm(id)
  10.   {
  11.     document.qSearch.action = "index.php?dc=2&id="+ id;
  12.     document.qSearch.submit()
  13.   }
What I need is the "id" var appended to the query string in the SubmitForm Function. Can someone tell me how to do this please? Thanks for the help!
Apr 3 '09 #2
Solved! Thanks for the help
Apr 3 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Ben | last post by:
The page below isn't picking up details or location. What have I missed? Thanks in advance, Ben ____________________________________________ <?PHP
7
by: Mike | last post by:
I've been trying for the past week to put a simple code together. I have done a LOT of searching, found scripts showing the functions I would like to use, however when I mix them it all goes wrong,...
2
by: Margaret Werdermann | last post by:
Hi all: I'm having a nasty time with a particularly difficult piece of code and was hoping someone might be able to help me. I have a FormMail form that originally worked perfectly. Then, I...
2
by: Barnes | last post by:
Hi, Can anyone please tell me how I can use the replace method to replace a character if it occures in more than one textbox without having to write separate function for each textbox. The...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
8
by: horos | last post by:
hey all, Ok, a related question to my previous one on data dumpers for postscript. In the process of putting a form together, I'm using a lot of placeholder variables that I really don't care...
2
by: this one | last post by:
I have the following code <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script language="JavaScript"...
1
by: dreamlab | last post by:
Hello, Can one of you javascript wizards help out a newbie, please? I’ve got a formHandler that is supposed to check for a good email address and name in the form after clicking the submit...
1
by: JumpingOffPlace | last post by:
Hi, I'm hoping that the wealth of knowledge here can stop me from spinning my wheels on this syntax error for hours. :) Below is the code, and the error I am recieving.... Code: <!DOCTYPE...
5
by: settyv | last post by:
Hi, Below is the Javascript function that am trying to call from asp:Button control. <script language="javascript"> function ValidateDate(fromDate,toDate) { var fromDate=new Date();
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.