/    Sign up×
Community /Pin to ProfileBookmark

Assigning values to <input> field

[B]This is javascript file (Addr.js) file:[/B]

function Address(){}
Address.prototype.addForm=function(map) {

[B] var Address = unescape(params[“Address”]);
var City = unescape(params[“City”]);
var State = unescape(params[“State”]);
var Zip_Code = unescape(params[“Zip_Code”]);[/B]

this.frm=map.ownerDocument.createElement(‘div’);
this.frm.m = this;
this.frm.id = ‘AddressFormDiv’;
this.frm.style.position=’relative’;
this.frm.style.backgroundColor=’#7996B0′;
this.frm.style.zIndex=35501;
this.frm.style.visibility=”visible”;
this.frm.innerHTML = ‘<span style=”color:red; font-size:12px;” id=”AddressError”></span><br/><br/><a href=”#” style=”position:absolute;right:0px;top:0px;” onclick=”this.parentNode.m.showhide()”>[View]</a><br/><b>Enter Full Address</b><br/><form id=”AddressFormUs” onSubmit=”this.parentNode.m.callvalue(this.addr.value); return false”>[B]<input name=”addr” size=”50″ value = “”+ Address + City + State + Zip_Code”” />[/B]<br/><input type=”Submit” value=”Get Location”/></form>’;
this.setOpacity(this.frm,100);
add.div.parentNode.appendChild(this.frm);

}

[B]It should do the following…..

-It should assign retrieved values “Address, City State, Zip_Code” values to my <input> addr field. [/B]

var Address = unescape(params[“Address”]);
var City = unescape(params[“City”]);
var State = unescape(params[“State”]);
var Zip_Code = unescape(params[“Zip_Code”]);

<input name=”addr” size=”50″ value = “”+ Address + City + State + Zip_Code”” />

[B]

-The user shouldn’t be able to edit the <input> addr, they should only be able click submit button to pass the values. [/B]

It’s not passing any values… can someone please help me with this.

thank you

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@T__AnreNov 03.2005 — My english is very bad, probably i don't understand question.

To disable html-tags use attibute disabled(boolean)
<i>
</i>&lt;input
disabled="true"
name="addr"
size="50"
value = ""+ Address + City + State + Zip_Code""
/&gt;
Copy linkTweet thisAlerts:
@dcentndnauthorNov 03.2005 — Hey T.Anre,

Thank you it worked, now would you know how i can retrive the values into the <input> tag?.. Thats my major problem.

var Address = unescape(params["Address"]);

var City = unescape(params["City"]);

var State = unescape(params["State"]);

var Zip_Code = unescape(params["Zip_Code"]);


<input name="addr" size="50" value = ""+ Address + City + State + Zip_Code"" />


value = ""+ Address + City + State + Zip_Code"" /> doesn't seem to do anything
Copy linkTweet thisAlerts:
@LeruraNov 06.2005 — give your input an id and an empty value;
[CODE]<input name="addr" id="addr" size="50" value = "" />[/CODE]
and then set the value by
[CODE]document.getElementById('addr').value=Address + City + State + Zip_Code;[/CODE]

beside that:

you can't use [COLOR=Red][B][/B][/COLOR] to escape a quote in html.

here you must use [COLOR=Red][B]&quot;[/B][/COLOR] or [COLOR=Red][B]&#38;#34;[/B][/COLOR] for a double quotation mark

and [COLOR=Red][B]&#38;#39;[/B][/COLOR] for a single quotation mark
×

Success!

Help @dcentndn 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,
)...