Page 1 of 1

Refresh form with value selected from combo / drop down box

Posted: Sun Dec 26, 2004 2:08 am
by vikaspa
I have a form for say weather

I want user to select a month from combo or drop down box having months (January to December) and want to refresh the information with certain details like temperature during day and night and season (rainy, autum, winteretc) already stored in database ...

Please help !!

At present I can submit the form using following javascript

document.form.submit();

However help me how do i refresh form with current value (of month chosen) by the user.

Posted: Sun Dec 26, 2004 2:18 am
by feyd
use the onchange event available in the select tag, however, you should provide the user an ability to manually submit the change (in case they have scripting turned off)

Posted: Mon Dec 27, 2004 1:30 am
by n00b Saibot
Vikas Bhai, as feyd has told ya use onchange event to accept the change from combo box. then u should update the result by using something like document.form.temperature.Value = 98 etc.

Bye 4 Now! :P

Posted: Mon Dec 27, 2004 5:08 am
by seth1334
If you want to do a database lookup without reloading the page, you can use a popup window which calls aphp script to do the lookup, and a bit of javascript to set opener.document.forms[whatever].elements[whatever] to the desired value.
HTH