/    Sign up×
Community /Pin to ProfileBookmark

onclick event in javascript

Hi all,

In this forum page when I click on ‘search’ , a textbox opens and inside i can see the form fields. how to achieve this in javascript?

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@SelrachJan 06.2006 — I don't know how this particular forum did it, but you could, in response to the OnClick event run a function that first places the div at the proper location, unhides the div that contains the form, then expands its height and width until it meets the specified dimensions.

Something like:

[CODE]function gebi(name){
return document.getElementById(name)
}

function searchBox(clickedDivName){
gebi(this.searchBoxName).style.top = gebi(clickedDivName).style.height;
gebi(this.searchBoxName).style.left = gebi(clickedDivName).style.left;
gebi(this.searchBoxName).style.width = 0;
gebi(this.searchBoxName).style.height = 0;
gebi(this.searchBoxName).style.visibility = "visible";
var i;
for(i =0; i<properHeight; i++){
gebi(this.searchBoxName).style.width = gebi(this.searchBoxName).style.width + 1;
gebi(this.searchBoxName).style.height= gebi(this.searchBoxName).style.height+ 1;
}
for(; i<properWidth; i++){
gebi(this.searchBoxName).style.width = gebi(this.searchBoxName).style.width + 1;
}
}[/CODE]
Copy linkTweet thisAlerts:
@shigaauthorJan 06.2006 — Many thanks for your valuable reply. I got it now!
×

Success!

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