/    Sign up×
Community /Pin to ProfileBookmark

Ok here is the problem.

i have 3 fields , 1 select box, 1 input, 1 answer field, what i have so fare is an auct complete script when you enter the first few letters in the input12 field it auto completes in both input12 & the options menu. the 3rd field is dead what i need is onchange a second value for an amount eg”€200″ to be entered in the amount field. I think at this stage i am confusing my self. So here is the script. i know there is a lot there but could someone help PLEASE!!!!!!!!!

Kind Regards
Aiden

<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-<option>” />
<title>Untitled Document</title>

<script>
<!–

function autoComplete (field, select, property, forcematch) {
var found = false;
for (var i = 0; i < select.options.length; i++) {
if (select.options[i][property].toUpperCase().indexOf(field.value.toUpperCase()) == 0) {
found=true; break;
}
}
if (found) { select.selectedIndex = i; }
else { select.selectedIndex = -1; }
if (field.createTextRange) {
if (forcematch && !found) {
field.value=field.value.substring(0,field.value.length-1);
return;
}
var cursorKeys =”8;46;37;38;39;40;33;34;35;36;45;”;
if (cursorKeys.indexOf(event.keyCode+”;”) == -1) {
var r1 = field.createTextRange();
var oldValue = r1.text;
var newValue = found ? select.options[i][property] : oldValue;
if (newValue != field.value) {
field.value = newValue;
var rNew = field.createTextRange();
rNew.moveStart(‘character’, oldValue.length) ;
rNew.select();
}

//–>
</script>

</head>

<body>
<p>&nbsp;</p>
<form id=”form<option>” name=”form<option>” method=”post” action=””>
<label><input type= “text” name=”input12″ value=”” onkeyup=”autoComplete(this,this.form.options,’value’,true)” />
<select name= “options” onchange=”this.form.input1.value=this.options[this.selectedIndex].value”>
<option value=”Abbey Park”>Abbey Park</option>
<option value=”Abbotstown Ave.”>Abbotstown Ave.</option>
<option value=”Adelaide Rd.”>Adelaide Rd.</option>
<option value=”Ailesbury Rd.”>Ailesbury Rd.</option>
<option value=”Airport (Dublin)”>Airport (Dublin)</option>
<option value=”Albert Rd.”>Albert Rd.</option>
<option>Alexandra Basin (Ext. Gates)</option>
<option>Alexandra Rd.</option>
<option>All Saints Rd.</option>
<option> Allenton Estate</option>
<option>Amiens St.</option>
<option>Angelsea Rd.</option>
<option>Annamoe Rd.</option>
</select>
</label>

<input name=”amount” type=”text” value”” readonly=””/>
<label>
<input name=”Button” type=”button” value=”Button” />
</label>
</form>

</p>
<label></label>
<p>
<label></label>
</p>
</body>
</html>
?

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@Major_PayneMay 07.2007 — Duplicate post:
Copy linkTweet thisAlerts:
@LeeUMay 07.2007 — Don't cross post. The other thread, and link above, have been removed. I also moved this to the JavaScript forum.
×

Success!

Help @aiden857181 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...