/    Sign up×
Community /Pin to ProfileBookmark

change value of hidden field without posting back to the server

Anyone has any ideas on how to change the value of a hidden field without posting back to the server using Javascript? I am looking for an AJAX alternative to do this. Any suggestions?

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@crushmeguyMar 09.2007 — you can simply reference the field and change its value property, ie:

[CODE]
document.getElementById('yourHiddenFieldID').value = 'my new value';
[/CODE]
Copy linkTweet thisAlerts:
@vicpal25authorMar 09.2007 — I should of defined my situation better..

I have form that populates a data grid. I want to have the ability for the user to display with details or without details. I was thinking how to pass the value of a link to a hidden field without posting back to the server. My grid has to re-populate itself based on this condition so server side has to be invoked. I know I have to use AJAX for this but I was just thinking of a simpler method of going about this.
Copy linkTweet thisAlerts:
@crushmeguyMar 09.2007 — What 'value' of the link are you referring to? The href?
×

Success!

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