codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  onClick Event Handler  influxer at 19:01 on Sunday, July 31, 2005
 

Hey all,

I am very new to javascript and have a really quick, simple script I need help writing.

I want to have a link on my page that when clicked, it will choose one of two radio buttons, and fill in a text field.

So, here is what I want:

[CODE]
<input name="page_width" type="text"><br>
<input name="page_width_type" type="radio" value="percent">  
<input name="page_width_type" type="radio" value="pixels"><br><br>
<a href="#" onClick="WHAT GOES HERE">full screen</a>
[/CODE]

I want to add a link right below it that sets the textbox (page_width) to '100' and selects the first radio button (percent).

Thanks,
-influxer

  Re: onClick Event Handler  proghelper at 18:56 on Wednesday, August 24, 2005
 

Hi

Check this code. It may give you an idea

john

http://www.programminghelp4u.com/ ( Assignment / Project ) Help

<!--
<script language="javascript">
function setWidth(){
var widthText ="";
var widthValue=document.form1.page_width.value;

if(document.form1.page_width_type[0].checked){
widthText =widthValue+"%";
}else{
widthText =widthValue;
}
table1.style.width=widthText;

}
</script>

<body>
<form name="form1">
<table width="50%" id="table1" border="1">
<tr>
<td>
<input name="page_width" type="text" value="30"><br>
</td>
</tr>
<tr>
<td>
<input name="page_width_type" type="radio" value="percent" checked>Percent
<input name="page_width_type" type="radio" value="pixels">Pixels<br><br>
<a href="javascript:setWidth()">set width</a>
</td>
</tr>
</table>
</form>
</body>
</html>
-->








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Develop website with 3 tier architecture
•  Re: TaylorMade R11s Fairway Wood
•  Re:
•  What do you mean by ASP.NET MVC Execution Process?
•  Re:
•  Re:
•  one java progarm handle two socket connection
•  How to navigate database page?
•  "Fitting Wedges


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2012