aej1973
asked on
question regarding ajax suggest ...
I have a ajax auto complete form. I am using the example from the following site:
http://www.brandspankingnew.net/specials/ajax_autosuggest/ajax_autosuggest_autocomplete.html
Insted of the array they have used in the example I have connected a datebase using php. The application is set up in such a way that once I make the selection I need to press the submit button to have the output passed to the next page. BUT I need to out to be passed as soon as a selection is make without having to press the select button. How do I do this? Thank you for the help.
A
http://www.brandspankingnew.net/specials/ajax_autosuggest/ajax_autosuggest_autocomplete.html
Insted of the array they have used in the example I have connected a datebase using php. The application is set up in such a way that once I make the selection I need to press the submit button to have the output passed to the next page. BUT I need to out to be passed as soon as a selection is make without having to press the select button. How do I do this? Thank you for the help.
A
include autopostback="True"
ASKER
for example take a look at this site:
http://lyricsfly.com/search/search.php
I do not have to use the search button.
Lunadl: where do I need to insert 'autopostback' ?
Nizsmo: this is a text box not a menu list.
Thanks for getting back to me.
http://lyricsfly.com/search/search.php
I do not have to use the search button.
Lunadl: where do I need to insert 'autopostback' ?
Nizsmo: this is a text box not a menu list.
Thanks for getting back to me.
I think you would still use the onchange property, it still applies for text boxes as well, same syntax as above.
oh you wouldn't even need autopostback.. what type of control is your 'hidden field'? If it is html you can put a postback ontextchange or if its an asp control you can add ontextchange with autopostback enabled.. what platform are you using?
ASKER
php
shoot me i'm confused.. i was doing .net all day today.. didn't even read your question completely i guess. PHP. you want to do a postback on text change for your hidden field
ASKER
ha, ha. Thanks, I will try this change in a little while.
ASKER
It does not seem to be working. My code is as follows:
<form method="post" action="subscriber_details .php">
<label for="testinput_1_xml"><spa n class="style1">Account# </span></label>
<p>
<input type="text" id="testinput_1_xml" style="width:300px" name="D1" onChange="subscriber_detai ls.php"/>
<br />
<br />
<input type="submit" value="submit" />
</p>
<p> </p>
</form>
</div>
<h2> </h2>
<h3> </h3>
</div>
</div>
<script type="text/javascript">
var options = {
script:"test.php?json=true &",
varname:"input",
json:true,
callback: function (obj) { document.getElementById('t estid').va lue = obj.id; }
};
var as_json = new AutoSuggest('testinput', options);
var options_xml = {
script:"test.php?",
varname:"input"
};
var as_xml = new AutoSuggest('testinput_xml ', options_xml);
</script>
<script type="text/javascript">
var options = {
script:"test_1.php?json=tr ue&",
varname:"input",
json:true,
callback: function (obj) { document.getElementById('t estid').va lue = obj.id; }
};
var as_json = new AutoSuggest('testinput_1', options);
var options_xml = {
script:"test_1.php?",
varname:"input"
};
var as_xml = new AutoSuggest('testinput_1_x ml', options_xml);
</script>
<form method="post" action="subscriber_details
<label for="testinput_1_xml"><spa
<p>
<input type="text" id="testinput_1_xml" style="width:300px" name="D1" onChange="subscriber_detai
<br />
<br />
<input type="submit" value="submit" />
</p>
<p> </p>
</form>
</div>
<h2> </h2>
<h3> </h3>
</div>
</div>
<script type="text/javascript">
var options = {
script:"test.php?json=true
varname:"input",
json:true,
callback: function (obj) { document.getElementById('t
};
var as_json = new AutoSuggest('testinput', options);
var options_xml = {
script:"test.php?",
varname:"input"
};
var as_xml = new AutoSuggest('testinput_xml
</script>
<script type="text/javascript">
var options = {
script:"test_1.php?json=tr
varname:"input",
json:true,
callback: function (obj) { document.getElementById('t
};
var as_json = new AutoSuggest('testinput_1',
var options_xml = {
script:"test_1.php?",
varname:"input"
};
var as_xml = new AutoSuggest('testinput_1_x
</script>
if you just use an alert or something for the onchange does it work?
ASKER
Hi Lunadl, yes the alert works.
<form method="post" action="">
<small style="float:right"><input type="text" id="testid" name="D1" readonly="1"/></small>
<label for="testinput">Subscriber Name </label>
<input style="width: 200px" type="text" id="testinput" value="" onChange="alert()"/>
<input type="submit" value="submit" />
</form>
<form method="post" action="">
<small style="float:right"><input
<label for="testinput">Subscriber
<input style="width: 200px" type="text" id="testinput" value="" onChange="alert()"/>
<input type="submit" value="submit" />
</form>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hello Lunadl, sorry for the delay in getting back to you. I tried this code, what happens is that I am redirected to the next page ''onChange' but the value is not being passed (in this case 'D1')
<!--===========MY CODE====================== -->
<form method="get" action="subscriber_details .php" name="subscriber">
<label for="testinput">Subscriber Name </label>
<input style="width: 200px" type="text" id="testinput" /> // This field is the auto suggest field for the subscriber name
<input type="hidden" id="testid" value="" readonly="1" name="D1" onChange="dopb()"/> //hidden field that has the account# of the subscriber. Account# needs to be passed to the next form.
</form>
<!--=====================j ava scirpt you had suggested==============-->
<script language="javascript">
function dopb()
{
document.subscriber.submit ();
}</script>
Any suggestions? Thank you.
A
<!--===========MY CODE======================
<form method="get" action="subscriber_details
<label for="testinput">Subscriber
<input style="width: 200px" type="text" id="testinput" /> // This field is the auto suggest field for the subscriber name
<input type="hidden" id="testid" value="" readonly="1" name="D1" onChange="dopb()"/> //hidden field that has the account# of the subscriber. Account# needs to be passed to the next form.
</form>
<!--=====================j
<script language="javascript">
function dopb()
{
document.subscriber.submit
}</script>
Any suggestions? Thank you.
A
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Forced accept.
Computer101
EE Admin
Computer101
EE Admin
Something like this:
<select onchange="callMyFunction()
// options here
</selec>