|
|
|
|
![]() ![]() |
![]() Group: Members
Posts: 15 Joined: 18-July 06 Member No.: 26,810 |
Post
#1
Jul 31 2006, 03:06 PM
hi, I am new in web development i want to make a page in which there are few buttons and on click of each button there is some hidden text field which becomes visible and user can enter the text he wish to in it. how can i ? |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members
Posts: 621 Joined: 30-July 06 From: Earth, Usa, Maine, Waterford, Member No.: 27,507 ![]() |
Post
#2
Aug 1 2006, 03:07 AM
I have posted a few things that could help me about that stupid Cpanel I am still looking what icon I click on to make the website!! In my one day of being here. I am kinda disapointed. I wish that the shoutbox was working |
![]() Group: Members
Posts: 15 Joined: 18-July 06 Member No.: 26,810 |
|
![]() ![]() Group: Members
Posts: 34 Joined: 11-July 06 Member No.: 26,467 |
Post
#4
Aug 1 2006, 01:16 PM
You guys should search for css tutorial.. it would help you... It's very easy... Look for it on google...
|
![]() ![]() Group: Members
Posts: 29 Joined: 3-November 06 Member No.: 32,672 |
Post
#5
Nov 3 2006, 08:02 AM
QUOTE(h1dd3n @ Jul 31 2006, 11:06 PM) [snapback]270638[/snapback] hi, I am new in web development i want to make a page in which there are few buttons and on click of each button there is some hidden text field which becomes visible and user can enter the text he wish to in it. how can i ? ok, i have some time let me have a try CODE // test.html <html> <head> <title>just a demo</title> <style type="text/css"> /*<![CDATA[*/ #div1 { display:none; } #div2 { display:none; } /*]]>*/ </style> <script type="text/javascript"> //<![CDATA[ function show(id) { if(id == 1) { document.getElementById('div1').style.display='block'; document.getElementById('div2').style.display='none'; } else { document.getElementById('div2').style.display='block'; document.getElementById('div1').style.display='none'; } } //]]> </script> </head> <body> <div id="div1"> <input type="text" name="txt1" value="here is text1 content" /> </div> <div id="div2"> <input type="text" name="txt2" value="here is text2 content" /> </div> <input type="button" value="button1" onclic="show(1);" /> <input type="button" value="button2" onclic="show(2);" /> </body> </html> |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Post
#6
Nov 3 2006, 08:23 AM
INTO HEAD: CODE <script type="text/javascript"> function show_buttons(show) { if (show == 'content_A') { document.getElementById('content_B').style.visibility='hidden'; document.getElementById('content_A').style.visibility='visible'; } else { document.getElementById('content_A').style.visibility='hidden'; document.getElementById('content_B').style.visibility='visible'; } } </script> INTO BODY: CODE <input type="button" onclick="show_buttons('content_A');" value="Show A"> <input type="button" onclick="show_buttons('content_B');" value="Show B"> <input type="text" value="A" id="content_A" style="visibility: hidden"> <input type="text" value="B" id="content_B" style="visibility: hidden"> Both will give different results. Mine will reserve space on the page for text fields whereas derickkoo's won't. When a user displays his the content on the page will move down slightly - or so I believe. Try them both out. NB: CODE <input type="button" value="button1" onclic="show(1);" /> <input type="button" value="button2" onclic="show(2);" /> Should read: CODE <input type="button" value="button1" onclick="show(1);" />
<input type="button" value="button2" onclick="show(2);" /> |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members
Posts: 5,876 Joined: 21-September 07 Member No.: 50,369 |
Post
#7
Apr 17 2009, 10:00 PM
How to make it 3 Help Writing An Html Code (onclick Open Something) Hi, I am having some problems with this, the following code works: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.W3.Org/TR/xhtml1/DTD/xhtml1-transitional.Dtd"> <input type="button" value="button1" onclick="show(1);" /> But when I try to make 3 div boxes and 3 buttons it fails miserably! Even the first 2 buttons stop working! The code I am using goes like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.W3.Org/TR/xhtml1/DTD/xhtml1-transitional.Dtd"> <input type="button" value="button1" onclick="show(1);" /> </div> Also is there a way to put a default div box on show when the page is first loaded but is then hidden when a button is pressed? Cheers Tom
Keywords: php onclick tutorial |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members
Posts: 5,876 Joined: 21-September 07 Member No.: 50,369 |
Post
#8
Sep 16 2009, 06:42 AM
dynamic add buttons in html Help Writing An Html Code (onclick Open Something) Hi, I want a dynamic add button in html code so that when I click on it, it will dispay a text box... Please help.. -reply by antika |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Post
#9
Sep 20 2009, 10:44 AM
Just stick to this simple logic, when you wan a box to appear, set the style to "display:none", whether it's dynamic or manual set. If you want a box to be shown as default, set the style to "display:none", then when you click a button to show the box, use javascript onclick function to set it to "display:block". Same goes for you textbox. Example for click to display a text box" CODE <script type="text/javascript">
function showbox() { document.getElementById('box1').style.display = 'block'; } </script> <div id="box1"> <input type="text" /> </div> |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members
Posts: 5,876 Joined: 21-September 07 Member No.: 50,369 |
Post
#10
Sep 21 2009, 02:51 AM
help with html Help Writing An Html Code (onclick Open Something) friends I am very new to html I am finding adding image to the page difficult I know the code is easy but I have tried many images but the pic does not come when I open the browser it shows a broken image. So Please help -question by sudhi |
![]() ![]() |
Similar Topics
| Topic Title | Replies | Topic Starter | Views | Last Action | |||
|---|---|---|---|---|---|---|---|
![]() |
1 | illnet | 6,195 | 20th June 2004 - 04:50 PM Last post by: ultrasmad |
|||
![]() |
108 | chelcy | 83,343 | 18th September 2009 - 09:07 PM Last post by: domguan |
|||
![]() |
3 | -Sky- | 657 | 12th June 2009 - 08:48 PM Last post by: -Sky- |
|||
![]() |
21 | tinoymalayil | 1,410 | 17th November 2009 - 05:27 PM Last post by: iG-Ed Boi |
|||
![]() |
40 | EricDrinkard | 39,755 | 1st November 2009 - 01:34 PM Last post by: Www.AnthonyLazaroni.Com |
|||
![]() |
11 | football123213 | 8,634 | 30th July 2004 - 03:34 PM Last post by: templest |
|||
![]() |
7 | odomike | 19,017 | 30th April 2008 - 02:44 PM Last post by: FeedBacker |
|||
![]() |
97 | Xenon | 47,355 | 29th October 2009 - 04:25 PM Last post by: magiccode9 |
|||
![]() |
132 | djleli | 40,497 | 17th November 2009 - 11:06 AM Last post by: mahesh2k |
|||
![]() |
11 | bttfpromo | 11,537 | 14th September 2004 - 08:55 PM Last post by: Magic-Node |
|||
![]() |
10 | Saint_Michael | 8,946 | 7th May 2009 - 07:13 AM Last post by: contactskn |
|||
![]() |
54 | habbovalley | 3,901 | 5th November 2009 - 09:59 AM Last post by: Ho-oh'sRealm |
|||
![]() |
0 | deedee2003 | 3,740 | 5th September 2004 - 09:11 PM Last post by: deedee2003 |
|||
![]() |
6 | XtremeGamer99 | 6,313 | 9th February 2005 - 10:48 AM Last post by: alexwhin |
|||
![]() |
25 | gijoe18 | 24,496 | 20th February 2009 - 06:55 PM Last post by: MALISH_ |
|||
|
Open Discussion | Time is now: 21st November 2009 - 07:39 AM |
Web Hosting Powered by ComputingHost.com.