Page 1 of 1

after refresh value in the drop down list is not coming

Posted: Wed Aug 03, 2011 11:34 pm
by singhsugandha3

Code: Select all

<script type="text/javascript">

function f1(a)
{

if(a==1)
{

window.location= "http://kansascityrehabloans.com/index.php?&pf=3";

}
if(a==2)
{

window.location= "http://kansascityrehabloans.com/index.php?&pf=4";
}
else if(a==3)
{
window.location = "http://kansascityrehabloans.com/index.php?&pf=5";
}
if(a==4)
{
window.location = "http://kansascityrehabloans.com/index.php?&pf=6";
}
if(a==5)
{
window.location = "http://kansascityrehabloans.com/index.php?&pf=7";
}

}
</script>

<form name="frm">
<center><span>Select Loan type : </span>
<select size="1" style="width:135px;"  onchange="javascript:f1(this.value);" name="ddl" id="ddl">

<option value="0">Select One</option>
<option value="1">New Home Loan</option>
<option value="2">Refinance Home Loan</option>
<option value="3">Relocation Home Loan</option>
<option value="4">Strategic Partner</option>
<option value="5">General Inquiry</option>
</select>
</center>
</form>

select option

Posted: Wed Aug 03, 2011 11:36 pm
by singhsugandha3
How to get selected value of html select/dropdown list with Javascript

Code: Select all

<script type="text/javascript">

function f1(a)
{
if (a==1)
{
document.getElementById("ddl").options[1].selected=true;
window.location= "http://kansascityrehabloans.com/index.php?&pf=3";
}
if(a==2)
{
document.getElementById("ddl").options[2].selected=true
window.location= "http://kansascityrehabloans.com/index.php?&pf=4";
}
if(a==3)
{
document.getElementById("ddl").options[3].selected=true
window.location = "http://kansascityrehabloans.com/index.php?&pf=5";
}
if(a==4)
{
document.getElementById("ddl").options[4].selected=true
window.location = "http://kansascityrehabloans.com/index.php?&pf=6";
}
if(a==5)
{
document.getElementById("ddl").options[5].selected=true
window.location = "http://kansascityrehabloans.com/index.php?&pf=7";
}

}
</script>

<form name="frm">
<center><span>Select Loan type : </span>
<select size="1" style="width:135px;"  onchange="f1(this.value)" id="ddl">

<option value="0">Select One</option>
<option value="1">New Home Loan</option>
<option value="2">Refinance Home Loan</option>
<option value="3">Relocation Home Loan</option>
<option value="4">Strategic Partner</option>
<option value="5">General Inquiry</option>
</select>
</center>
</form>

Re: after refresh value in the drop down list is not coming

Posted: Thu Aug 04, 2011 12:50 am
by Benjamin
Please use the appropriate

Code: Select all

 [ /code] tags when posting code blocks in the forums. Functions in your code will be automatically linked to manual entries and your code will be syntax highlighted making it much easier for everyone to read. You will most likely receive more answers as well.

[quote="Forum Rules"]
11. Please use proper, complete spelling when posting in the forums. AOL Speak, leet speak and other abbreviated wording can confuse those that are trying to help you (or those that you are trying to help). Please keep in mind that there are many people from many countries that use our forums to read, post and learn. They do not always speak English as well as some of us, nor do they know these aberrant abbreviations. Therefore, use as few abbreviations as possible, especially when using such simple words.
[/quote]

[quote="Forum Rules 1 1.1 4"]
4. All users of any level are restricted from bumping ([url=http://en.wikipedia.org/wiki/Bump_(internet)]as defined here[/url]) any given thread within twenty-four (24) hours of its last post. Non-trivial posts are not considered bumping. A bump post found in violation will be deleted, and you may or may not receive a warning. Persons bumping excessively be considered as spammers and dealt with accordingly.
[/quote]

You may also want to read:
[list=1]
[*][url=http://forums.devnetwork.net/viewtopic.php?t=8815]General Posting Guidelines[/url]
[*][url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url]
[*][url=http://php.net/]PHP Manual[/url]
[*][url=http://www.google.com/search?client=opera&rls=en&q=php+tutorials&sourceid=opera&ie=utf-8&oe=utf-8]PHP Tutorials[/url][/list]