Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > Adobe Web Programming > ActionScript
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ActionScript Discuss the Adobe Actionscript language
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ActionScript section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Display Modes
  #1 (permalink)  
Old October 18th, 2015, 12:41 PM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Oct 2015
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default help please... newbie at javascript

i just want to create a simple script
i just want to display the value of what i selected radio button to the textbox
here's my code... TIA

function validateForm() {

var x = document.forms["myForm"]["ticket_no"].value.length===5;
if (x == null || x == "") {
alert("ticket_no must be filled out or must 5 numbers only");
return false;

var x = document.forms["myForm"]["school_name"].value;
if (x == null || x == "") {
alert("school_name must be filled out");
return false;

var x = document.forms["myForm"]["region"].value;
if (x == null || x == "") {
alert("region must be filled out");
return false;

var x = document.forms["myForm"]["municipality"].value;
if (x == null || x == "") {
alert("municipality must be filled out");
return false;

var x = document.forms["myForm"]["comment"].value;
if (x == null || x == "") {
alert("comment must be filled out");
return false;


function popitup() {

var w = 900;
var h = 800;
var left = (screen.width/2)-(w/2);
var top = (screen.height/2)-(h/2);
var newwindow2 = window.open('','','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+ top+', left='+left);
var tmp = newwindow2.document;
tmp.write('<html><head><title>Region Selection</title>');
tmp.write('<link rel="stylesheet" href="js.css">');
tmp.write('</head><body><p>Select a Region.</p>');

tmp.write('<form name="myForm">');
tmp.write('<input type="radio" name="region" value="Region 1">Region 1<br>');
tmp.write('<input type="radio" name="region" value="Region 2">Region 1<br>');
tmp.write('<input type="button" onclick="myFunction()" value="Submit Region">');
tmp.write('<p><a href="javascript:self.close()">Close</a></p>');


function myFunction() {
var region = document.myForm[0];
var txt = "";
var i;
for (i = 0; i < region.length; i++) {
if (region[i].checked) {
txt = txt + region[i].value + " ";
document.myform.getElementById.value = text;

<form name="myForm" action="add_school.php" onSubmit="return validateForm()" method="post">
<table style="width:30%" border="0">
<td><center>ticket_no: </center></td>
<td><input type="text" name="ticket_no"></td>

<td><center>school_name: </center></td>
<td><input type="text" name="school_name"></td>

<td><center>region: </center></td>
<td> <input type="text" name="region" id="order">
<button type="button" onClick="popitup()">Select</button></td>

<td><center>assigned_to: </center></td>
<td><input type="text" name="assigned_to"></td>

<td><center>municipality: </center></td>
<td><input type="text" name="municipality"></td>

<td><center>comment: </center></td>
<td><textarea name='comment' id='comment'></textarea><br /></td>

<td><center><input type="submit" value="Submit"></center></td>
<td><input type="reset" value="Clear"></td>


Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie (very newbie!) question about com.paad.* jkcashin BOOK: Professional Android 2 Application Development 3 June 5th, 2013 07:52 AM
newbie question (javascript passed in xml) mitre7 XSLT 4 December 11th, 2008 11:23 PM
stop current javascript function using javascript sakthi Javascript 3 June 2nd, 2008 04:30 PM
Newbie - Javascript Mizman Classic ASP Databases 1 January 27th, 2005 02:49 PM

All times are GMT -4. The time now is 04:45 AM.

Powered by vBulletin®
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.