Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

add another row dynamically 1

Status
Not open for further replies.

rjn2001

Programmer
Dec 29, 2004
172
0
0
GB
I am wanting to add another row of text fields dynamically,

ie. "date","Description",FurtherDetails"

So, how might I do that?

Would that affect the SQL/ASP statements for submission to the db?



Couldnt find any other posts about this.
 
try searching for DOM (Document Object Module) on the net.

Known is handfull, Unknown is worldfull
 
Code:
<table>
	<tr id=baseRow>
		<td><input name="date1"></td>
		<td><input name="desc1"></td>
	</tr>
</table>
<input type=button value="add" onClick="addRow()">


<script language=javascript>
	rowCount = 1
	function (addRow){
		rowCount ++
    		newRow = document.getElementById("baseRow").cloneNode(true)
		newRow.childNodes[0].childNodes[0].name = "date" + rowCount	//first input in first cell
		newRow.childNodes[0].childNodes[0].value = ""
		newRow.childNodes[1].childNodes[0].name = "desc" + rowCount	//first input in second cell
		newRow.childNodes[1].childNodes[0].value = ""
		document.getElementById("baseRow").parentNode.appendChild(newRow)
	}

</script>


Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook

zen.gif

 
mwolf00, thanks, only, it dont add another record.

 
typo in function

Code:
function addRow(){

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook

zen.gif

 
Hi, just wondering, do u have the script to delete a row?

Thanks in advance
 
It will be easier to ID the proper row for deletion if you give each row an ID. Your new code will look similar to this...
Code:
<table BORDER=1>
    <tr id=baseRow>
 		<td><input name="date1"></td>
		<td><input name="desc1"></td>
		[blue]<td>Do Not Delete</td>[/blue]
    </tr>
</table>
<input type=button value="add" onClick="addRow()">


<script language=javascript>
    rowCount = 1
    function addRow(){
        	rowCount ++
        	newRow = document.getElementById("baseRow").cloneNode(true)
        	newRow.childNodes[0].childNodes[0].name = "date" + rowCount    //first input in first cell
        	newRow.childNodes[0].childNodes[0].value = ""
        	newRow.childNodes[1].childNodes[0].name = "desc" + rowCount    //first input in second cell
       	 newRow.childNodes[1].childNodes[0].value = ""

[blue]		newRow.id = "row" + rowCount
		newButton = document.createElement("input")
 		newButton.id = "button" + rowCount
		newButton.type = "button"
		newButton.value = "Delete"
		newButton.attachEvent("onclick", deleteRow)
		newRow.childNodes[2].childNodes[0].replaceNode(newButton) [/blue]

        	document.getElementById("baseRow").parentNode.appendChild(newRow)
    }

[blue]	function deleteRow(){
		buttonID = event.srcElement.id		// ie - "button2"
		rowID = buttonID.substr(6)			// ie - "2"
		document.getElementById("row" + rowID).removeNode(true)
	}[/blue]
</script>

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook

zen.gif

 
Can anyone help with this?, I am wanting to have 4/5 input rows, and it aint letting me do it, prob something simple.




<table BORDER=1>
<tr id=baseRow>
<td>Start Date<input name="JobDateStart" size="11"></td>
<td>End Date<input name="JobDateFinish" size="8"></td>
<td>Organisation Name<input name="EmployerName" size="13"></td>
<td>Your Role<input name="JobRole" size="11"></td>
<td>More Detail<input name="JobDetails" size="9"></td>
<td>Do Not Delete</td>
</tr>
</table>
<input type=button value="add" onClick="addRow()">


<script language=javascript>
rowCount = 1
function addRow(){
rowCount ++
newRow = document.getElementById("baseRow").cloneNode(true)
newRow.childNodes[0].childNodes[0].name = "JobDateStart" + rowCount //first input in first cell
newRow.childNodes[0].childNodes[0].value = ""
newRow.childNodes[1].childNodes[0].name = "JobDateFinish" + rowCount //first input in second cell
newRow.childNodes[1].childNodes[0].value = ""
newRow.childNodes[2].childNodes[0].name = "EmployerName" + rowCount //first input in third cell
newRow.childNodes[2].childNodes[0].value = ""
newRow.childNodes[3].childNodes[0].name = "JobRole" + rowCount //first input in fourth cell
newRow.childNodes[3].childNodes[0].value = ""
newRow.id = "row" + rowCount
newButton = document.createElement("input")
newButton.id = "button" + rowCount
newButton.type = "button"
newButton.value = "Delete"
newButton.attachEvent("onclick", deleteRow)
newRow.childNodes[4].childNodes[0].replaceNode(newButton)

document.getElementById("baseRow").parentNode.appendChild(newRow)
}

function deleteRow(){
buttonID = event.srcElement.id // ie - "button2"
rowID = buttonID.substr(6) // ie - "2"
document.getElementById("row" + rowID).removeNode(true)
}
</script>
 
Since you have a label before the input, a textNode is created, therefore you are now changing the second childNode (ie - [1]) for each TD

Code:
<table BORDER=1>
	<tr id=baseRow>
		<td>Start Date<input name="JobDateStart" size="11"></td>
		<td>End Date<input name="JobDateFinish" size="8"></td>
		<td>Organisation Name<input name="EmployerName" size="13"></td>
		<td>Your Role<input name="JobRole" size="11"></td>
		<td>More Detail<input name="JobDetails" size="9"></td>
		<td>Do Not Delete</td>
	</tr>
</table>
<input type=button value="add" onClick="addRow()">


<script language=javascript>
	rowCount = 1
	function addRow(){
		rowCount ++
		newRow = document.getElementById("baseRow").cloneNode(true)
		newRow.childNodes[0].childNodes[1].name = "JobDateStart" + rowCount    //first input in first cell
		newRow.childNodes[0].childNodes[1].value = ""
		newRow.childNodes[1].childNodes[1].name = "JobDateFinish" + rowCount    //first input in second cell
		newRow.childNodes[1].childNodes[1].value = ""
		newRow.childNodes[2].childNodes[1].name = "EmployerName" + rowCount    //first input in third cell
		newRow.childNodes[2].childNodes[1].value = ""
		newRow.childNodes[3].childNodes[1].name = "JobRole" + rowCount    //first input in fourth cell
		newRow.childNodes[3].childNodes[1].value = ""
		[blue]newRow.childNodes[4].childNodes[1].name = "JobDetails" + rowCount    //first input in fifth cell
		newRow.childNodes[4].childNodes[1].value = ""[/blue]
		newRow.id = "row" + rowCount
		newButton = document.createElement("input")
		newButton.id = "button" + rowCount
		newButton.type = "button"
		newButton.value = "Delete"
		newButton.attachEvent("onclick", deleteRow)
		newRow.childNodes[5].childNodes[0].replaceNode(newButton) 
		
		document.getElementById("baseRow").parentNode.appendChild(newRow)
	}
	
	function deleteRow(){
		buttonID = event.srcElement.id        // ie - "button2"
		rowID = buttonID.substr(6)            // ie - "2"
		document.getElementById("row" + rowID).removeNode(true)
	}
</script>

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook

zen.gif

 
Hi, I have a question..

I am trying to have two areas of the code mentioned in this post, to have one for submitting a project, one for submitting a job experience.

I have altered the code as i though it should be, but it is only adding a row to the first table, rather than independently.

Here is the code for the page:-


Code:
<%@ LANGUAGE="VBSCRIPT" %>
<!-- #include file="common.asp" -->
<!-- #include file="md5.asp" -->
<!-- #include file="rand.asp" -->
<%

Response.Expires = -1
Response.ExpiresAbsolute = Now() - 2
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "No-Store"

'------------------------------------------
'File: register.asp
'Description: User Registration Page
'---------------------------------------------
'Initliase variable
	dim strSecuritycode, strSecurityKey
	strSecuritycode = RandomPW(6)
	strSecurityKey = RandomPW(32)      
	
%>

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New User</title>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<link rel="stylesheet" type="text/css" href="css.css">
<script  language="JavaScript">
<!-- Hide from older browsers...

//Function to check form is filled in correctly before submitting
function CheckForm () {

	//Initialise variables
        var errorMsg = "";
        var errorMsgLong = "";

	//Check for a First Name
        if (document.reg.First_Name.value.length == ""){
                errorMsg += "\n\tFirst Name \t- Your must enter your First Name";
        }
    
    //Check for a Last Name
        if (document.reg.last_name.value.length == ""){
                errorMsg += "\n\tLast Name \t- Your must enter your Last Name";
        }    
        
     //Check that the email address is valid
	if (document.reg.E_Mail.value.length <7&&(document.reg.E_Mail.value.indexOf("@",0)==-1||document.reg.E_Mail.value.indexOf(".",0)==-1)) {
		errorMsg += "\n\tEmail Address \t- Your must enter a valid Email Address";
		} 

    //Check for a State
        if (document.reg.state.value.length == ""){
                errorMsg += "\n\tState\t\t- Your must enter the State where you live";
        } 

	//Check for a username
        if (document.reg.UserID.value.length <= 3){
                errorMsg += "\n\tUserName \t- Your Username must be at least 4 characters";
        }

        //Check for a password
        if (document.reg.Password.value.length <= 3){
                errorMsg += "\n\tPassword \t- Your Password must be at least 4 characters";
        }

        //Check both passwords are the same
        if ((document.reg.Password.value) != (document.reg.Password2.value)){
                errorMsg += "\n\tPassword Error\t- The passwords entered do not match";
                document.reg.Password.value = "";
                document.reg.Password2.value = "";
        }
        
        //Check for a Security Answer
        if (document.reg.Sec_Ans.value.length == ""){
                errorMsg += "\n\tSecurity Ans\t- Your must enter Answer to your Security Question";
        } 
        
        //Check for a Security Answer
        if (document.reg.agree.checked == false){
                errorMsg += "\n\tAgreement\t- Your must Agree to User Agreement and Terms of Use";
        }

        //If there is a problem with the form then display an error
	if ((errorMsg != "") || (errorMsgLong != "")){
		msg = "_________________________________________________________________\n\n";
		msg += "The form has not been submitted because there are problem(s) with the form.\n";
		msg += "Please correct the problem(s) and re-submit the form.\n";
		msg += "_________________________________________________________________\n\n";
		msg += "The following field(s) need to be corrected: -\n";

		errorMsg += alert(msg + errorMsg + "\n" + errorMsgLong);
		return false;
	}

	return true;
}
// -->
//Function to check form is filled in correctly before submitting
function stat () {
		if (CheckForm()== true) {
			document.reg.Agreement.value = "Please wait, Account Wizard Register your Account......";
		}
}
function agree () {
			document.reg.Agreement.value = "Gernral Rules\nIf you agree with the following rules then click on the 'Accept' button at the bottom of the page if not click on the 'Cancel' button.\nWhen you register you are required to give a small amount of information, much of which is optional, anything you do give must be considered as becoming public information.\nYou agree not to use this forum to post any material which is vulgar, defamatory, inaccurate, harassing, hateful, threatening, invading of others privacy, sexually oriented, or violates any laws. You also agree that you will not post any copyrighted material that is not owned by yourself or the owners of these forums.\nYou remain solely responsible for the content of your messages, and you agree to indemnify and hold harmless this forum and their agents with respect to any claim based upon any post you may make. We also reserve the right to reveal whatever information we know about you in the event of a complaint or legal action arising from any message posted by yourself.\nAlthough messages posted are not the responsibility of this forum and we are not responsible for the content or accuracy of any of these messages, we reserve the right to delete any message for any or no reason whatsoever. If you do find any posts are objectionable then please contact the forum by e-mail. \n The Federal Trade Commission's Children's Online Privacy Protection Act of 1998 (COPPA) requires that Web Sites are to obtain parental consent before collecting, using, or disclosing personal information from children under 13. If you are below 13 then you can NOT use this forum. Do NOT register if you are below the age of 13. \n By registering to use this forum you meet the above criteria and agree to abide by all of the above rules and policies.";
		}

</script>
<script  language="JavaScript">


</script>		
</head>

<body bgcolor="#FFFFFF" bgproperties="fixed" link="#008000" onload="agree()">

<p><h1><img border="0" src="\images\BARLogo.gif" width="125" height="110">BAR Registration </h1>

<table width="100%" align=left height="25">
  <tr>
    <td width="50%" align=right height="21">
      <table>
        <tr>
          <td>
		<a href="reset_cookie.asp">Login Panel</a> | Submission Form 
		| <a href="edit.asp">Edit your Account</a> 

          </td>
        </tr>
      </table>
	</td>
  </tr>
</table>


<p>
<br clear="all">

<form METHOD="POST" action="verify.asp" name="reg" onsubmit="return CheckForm();">

<table border="0" cellspacing="2" style="border-collapse: collapse" bordercolor="#111111" width="892" id="AutoNumber1" height="128">
  <tr>
    <td width="884" bgcolor="#0E6B97" height="23" colspan="2" bordercolor="#0099CC">
    <p align="center"><font face="Verdana" color="#FFFFFF"><b>Please Provide Your Account 
    Information</b></font></td>
  </tr>
  <tr>
    <td width="293" bgcolor="#5C5CA8" height="23" bordercolor="#0099CC">
    <font color="#FFFFFF"><b>User ID:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </b>&nbsp;&nbsp;&nbsp; &nbsp;</font></td>
    <td width="585" height="23" bgcolor="#E9E9E9">
    <font color="#5C5CA8">
    <input name="UserID" size="10" value="" maxlength="15"> *</font></td>
  </tr>
  <tr>
    <td width="293" bgcolor="#5C5CA8" height="23" bordercolor="#0099CC">
    <font color="#FFFFFF"><b>Password: </b>
    </font></td>
    <td width="585" height="23" bgcolor="#E9E9E9">
    <font color="#5C5CA8">
    <input type="password" name="Password" size="10" value="" maxlength="15">*</font></td>
  </tr>
  <tr>
    <td width="293" bgcolor="#5C5CA8" height="23" bordercolor="#0099CC">
    <font color="#FFFFFF"><b>Re-Enter Password</b></font></td>
    <td width="585" height="23" bgcolor="#E9E9E9"> 
    <font color="#5C5CA8"> 
    <input type="password" name="Password2" size="10" value="" maxlength="15">*</font></td>
  </tr>
  <tr>
    <td width="293" bgcolor="#5C5CA8" height="23" bordercolor="#0099CC">
    <font color="#FFFFFF"><b>Security Question:</b></font></td>
    <td width="585" height="23" bgcolor="#E9E9E9"> <font color="#5C5CA8"> <select size="1" name="Sec_ques">
	<option value="What is your Pet Name?">What is your Pets Name?</option>
	<option value="Last Five Digits of Driving License?">Last Five Digits of Driving License?
	</option>
	<option value="Your Mothers Maiden Name?">Your Mothers Maiden Name?</option>
	<option value="Your Lucky Numbers ?">Your Lucky Numbers ?</option>
	</select>*</font></td>
  </tr>
  <tr>
    <td width="293" bgcolor="#5C5CA8" height="23" bordercolor="#0099CC">
    <font color="#FFFFFF"><b>Answer:</b></font></td>
    <td width="585" height="23" bgcolor="#E9E9E9">
    <font color="#5C5CA8">
    <input name="Sec_Ans" size="10" value="" maxlength="30">*&nbsp; </font> </td>
  </tr>
  <tr>
    <td width="884" bgcolor="#0E6B97" height="22" colspan="2" bordercolor="#0099CC">
    <p align="center"><b><font face="Verdana" color="#FFFFFF">Please Provide your Personal 
    Information</font></b></td>
  </tr>
  <tr>
    <td width="293" bgcolor="#5C5CA8" height="23" bordercolor="#0099CC"><font color="#FFFFFF"><b>
    First Name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </b>&nbsp;</font></td>
    <td width="585" height="23" bgcolor="#E9E9E9">
    <font color="#5C5CA8">
    <input name="First_Name" size="24" value="" maxlength="30">*</font></td>
  </tr>
  <tr>
    <td width="293" bgcolor="#5C5CA8" height="23" bordercolor="#0099CC">
    <font color="#FFFFFF"><b>Last Name:</b></font></td>
    <td width="585" height="23" bgcolor="#E9E9E9">
    <font color="#5C5CA8">
    <input name="last_name" size="24" value="" maxlength="30">*</font></td>
  </tr>
  <tr>
    <td width="293" bgcolor="#5C5CA8" height="23" bordercolor="#0099CC">
    <font color="#FFFFFF"><b>Birth Year: </b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    </font></td>
    <td width="585" height="23" bgcolor="#E9E9E9"><font color="#5C5CA8"><select size="1" name="Birth_year">
    <option value="1950">below 1950</option>
    <option value="1951">1951</option>
    <option value="1952">1952</option>
    <option value="1953">1953</option>
    <option value="1954">1954</option>
    <option value="1955">1955</option>
    <option value="1956">1956</option>
    <option value="1957">1957</option>
    <option value="1958">1958</option>
    <option value="1959">1959</option>
    <option value="1960">1960</option>
    <option value="1961">1961</option>
    <option value="1962">1962</option>
    <option value="1963">1963</option>
    <option value="1964">1964</option>
    <option value="1965">1965</option>
    <option value="1966">1966</option>
    <option value="1967">1967</option>
    <option value="1968">1968</option>
    <option value="1969">1969</option>
    <option value="1970">1970</option>
    <option value="1971">1971</option>
    <option value="1972">1972</option>
    <option value="1973">1973</option>
    <option value="1974">1974</option>
    <option value="1975">1975</option>
    <option value="1976">1976</option>
    <option value="1977">1977</option>
    <option value="1978">1978</option>
    <option value="1979">1979</option>
    <option value="1980">1980</option>
    <option value="1981">1981</option>
    <option value="1982">1982</option>
    <option value="1983">1983</option>
    <option value="1984">1984</option>
    <option value="1985">1985</option>
    <option value="1986">1986</option>
    <option value="1987">1987</option>
    <option value="1988">1988</option>
    <option value="1989">1989</option>
    <option value="1990">1990</option>
    <option value="1991">1991</option>
    <option value="1992">1992</option>
    <option value="1993">1993</option>
    <option value="1994">1994</option>
    <option value="1995">1995</option>
    <option value="1996">1996</option>
    <option value="1997">1997</option>
    <option value="1998">1998</option>
    <option value="1999">1999</option>
    <option value="2000">2000</option>
    <option value="2001">2001</option>
    <option value="2002">2002</option>
    <option value="2003">2003</option>
    </select>*</font></td>
  </tr>
  <tr>
    <td width="293" bgcolor="#5C5CA8" height="21" bordercolor="#0099CC">
    <font color="#FFFFFF"><b>Address:</b></font></td>
    <td width="585" height="21" bgcolor="#E9E9E9">
    <textarea rows="4" name="S1" cols="24"></textarea></td>
  </tr>
  <tr>
    <td width="293" bgcolor="#5C5CA8" height="23" bordercolor="#0099CC">
    <font color="#FFFFFF"><b>Postal/Zip Code:&nbsp;&nbsp;</b></font></td>
    <td width="585" height="23" bgcolor="#E9E9E9">
    <font color="#5C5CA8">
    <input name="Zip" size="11" value="" maxlength="30"><i>(Required)</i></font></td>
  </tr>
  <tr>
    <td width="293" bgcolor="#5C5CA8" height="21" bordercolor="#0099CC">
    <font color="#FFFFFF"><b>E Mail <font size="1">(</font></b><font size="2">General</font><font size="1"><b>):&nbsp; </b>
    </font>&nbsp;</font></td>
    <td width="585" height="21" bgcolor="#E9E9E9">
    <font color="#5C5CA8">
    <input name="E_Mail" size="20" value="" maxlength="50">*</font></td>
  </tr>
  <tr>
    <td width="293" bgcolor="#5C5CA8" height="21" bordercolor="#0099CC">
    <font color="#FFFFFF"><b>[URL unfurl="true"]www Link</b>:&nbsp;&nbsp;[/URL] </font> </td>
    <td width="585" height="21" bgcolor="#E9E9E9">
    <font color="#5C5CA8">
    <input name="www" size="20" value="[URL unfurl="true"]http://"[/URL] maxlength="100"><i>(optional)</i></font></td>
  </tr>
  <tr>
    <td width="293" bgcolor="#5C5CA8" height="23" bordercolor="#0099CC">
    <font color="#FFFFFF"><b>Gender:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </b></font></td>
    <td width="585" height="23" bgcolor="#E9E9E9"><b>
    <font color="#5C5CA8">
    <select size="1" name="sex">
    <option value="Male">Male</option>
    <option value="Female">Female</option>
    </select>*</font></b></td>
  </tr>
  <tr>
    <td width="293" bgcolor="#5C5CA8" height="19" bordercolor="#0099CC">
    <font color="#FFFFFF"><b>County/State:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    </b>
    </font></td>
    <td width="585" height="19" bgcolor="#E9E9E9">
    <font color="#5C5CA8">
    <input name="state" size="17" value="" maxlength="30">*</font></td>
  </tr>
  
  <tr>
    <td width="293" bgcolor="#5C5CA8" height="19" bordercolor="#0099CC">
    <font color="#FFFFFF"><b>Country :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </b>
    </font></td>
    <td width="585" height="19" bgcolor="#E9E9E9"><b>
    <font color="#5C5CA8">
    <select size="1" name="Country">
    
      		<option selected>United Kingdom</option>
                <option>United States</option>
                <option>Afghanistan</option>
                <option>Albania</option>
                <option>Algeria</option>
                <option>American Samoa</option>
                <option>Andorra</option>
                <option>Angola</option>
                <option>Anguilla</option>
                <option>Antarctica</option>
                <option>Antigua And Barbuda</option>
                <option>Argentina</option>
                <option>Armenia</option>
                <option>Aruba</option>
                <option>Australia</option>
                <option>Austria</option>
                <option>Azerbaijan</option>
                <option>Bahamas</option>
                <option>Bahrain</option>
                <option>Bangladesh</option>
                <option>Barbados</option>
                <option>Belarus</option>
                <option>Belgium</option>
                <option>Belize</option>
                <option>Benin</option>
                <option>Bermuda</option>
                <option>Bhutan</option>
                <option>Bolivia</option>
                <option>Bosnia Hercegovina</option>
                <option>Botswana</option>
                <option>Bouvet Island</option>
                <option>Brazil</option>
                <option>Brunei Darussalam</option>
                <option>Bulgaria</option>
                <option>Burkina Faso</option>
                <option>Burundi</option>
                <option>Byelorussian SSR</option>
                <option>Cambodia</option>
                <option>Cameroon</option>
                <option>Canada</option>
                <option>Cape Verde</option>
                <option>Cayman Islands</option>
                <option>Central African Republic</option>
                <option>Chad</option>
                <option>Chile</option>
                <option>China</option>
                <option>Christmas Island</option>
                <option>Cocos (Keeling) Islands</option>
                <option>Colombia</option>
                <option>Comoros</option>
                <option>Congo</option>
                <option>Cook Islands</option>
                <option>Costa Rica</option>
                <option>Cote D'Ivoire</option>
                <option>Croatia</option>
                <option>Cuba</option>
                <option>Cyprus</option>
                <option>Czech Republic</option>
                <option>Czechoslovakia</option>
                <option>Denmark</option>
                <option>Djibouti</option>
                <option>Dominica</option>
                <option>Dominican Republic</option>
                <option>East Timor</option>
                <option>Ecuador</option>
                <option>Egypt</option>
                <option>El Salvador</option>
                <option>England</option>
                <option>Equatorial Guinea</option>
                <option>Eritrea</option>
                <option>Estonia</option>
                <option>Ethiopia</option>
                <option>Falkland Islands</option>
                <option>Faroe Islands</option>
                <option>Fiji</option>
                <option>Finland</option>
                <option>France</option>
                <option>Gabon</option>
                <option>Gambia</option>
                <option>Georgia</option>
                <option>Germany</option>
                <option>Ghana</option>
                <option>Gibraltar</option>
                <option>Great Britain</option>
                <option>Greece</option>
                <option>Greenland</option>
                <option>Grenada</option>
                <option>Guadeloupe</option>
                <option>Guam</option>
                <option>Guatemela</option>
                <option>Guernsey</option>
                <option>Guiana</option>
                <option>Guinea</option>
                <option>Guinea-Bissau</option>
                <option>Guyana</option>
                <option>Haiti</option>
                <option>Heard Islands</option>
                <option>Honduras</option>
                <option>Hong Kong</option>
                <option>Hungary</option>
                <option>Iceland</option>
                <option>India</option>
                <option>Indonesia</option>
                <option>Iran</option>
                <option>Iraq</option>
                <option>Ireland</option>
                <option>Isle Of Man</option>
                <option>Israel</option>
                <option>Italy</option>
                <option>Jamaica</option>
                <option>Japan</option>
                <option>Jersey</option>
                <option>Jordan</option>
                <option>Kazakhstan</option>
                <option>Kenya</option>
                <option>Kiribati</option>
                <option>Korea, South</option>
                <option>Korea, North</option>
                <option>Kuwait</option>
                <option>Kyrgyzstan</option>
                <option>Lao People's Dem. Rep.</option>
                <option>Latvia</option>
                <option>Lebanon</option>
                <option>Lesotho</option>
                <option>Liberia</option>
                <option>Libya</option>
                <option>Liechtenstein</option>
                <option>Lithuania</option>
                <option>Luxembourg</option>
                <option>Macau</option>
                <option>Macedonia</option>
                <option>Madagascar</option>
                <option>Malawi</option>
                <option>Malaysia</option>
                <option>Maldives</option>
                <option>Mali</option>
                <option>Malta</option>
                <option>Mariana Islands</option>
                <option>Marshall Islands</option>
                <option>Martinique</option>
                <option>Mauritania</option>
                <option>Mauritius</option>
                <option>Mayotte</option>
                <option>Mexico</option>
                <option>Micronesia</option>
                <option>Moldova</option>
                <option>Monaco</option>
                <option>Mongolia</option>
                <option>Montserrat</option>
                <option>Morocco</option>
                <option>Mozambique</option>
                <option>Myanmar</option>
                <option>Namibia</option>
                <option>Nauru</option>
                <option>Nepal</option>
                <option>Netherlands</option>
                <option>Netherlands Antilles</option>
                <option>Neutral Zone</option>
                <option>New Caledonia</option>
                <option>New Zealand</option>
                <option>Nicaragua</option>
                <option>Niger</option>
                <option>Nigeria</option>
                <option>Niue</option>
                <option>Norfolk Island</option>
                <option>Northern Ireland</option>
                <option>Norway</option>
                <option>Oman</option>
                <option>Pakistan</option>
                <option>Palau</option>
                <option>Panama</option>
                <option>Papua New Guinea</option>
                <option>Paraguay</option>
                <option>Peru</option>
                <option>Philippines</option>
                <option>Pitcairn</option>
                <option>Poland</option>
                <option>Polynesia</option>
                <option>Portugal</option>
                <option>Puerto Rico</option>
                <option>Qatar</option>
                <option>Reunion</option>
                <option>Romania</option>
                <option>Russian Federation</option>
                <option>Rwanda</option>
                <option>Saint Helena</option>
                <option>Saint Kitts</option>
                <option>Saint Lucia</option>
                <option>Saint Pierre</option>
                <option>Saint Vincent</option>
                <option>Samoa</option>
                <option>San Marino</option>
                <option>Sao Tome and Principe</option>
                <option>Saudi Arabia</option>
                <option>Scotland</option>
                <option>Senegal</option>
                <option>Seychelles</option>
                <option>Sierra Leone</option>
                <option>Singapore</option>
                <option>Slovakia</option>
                <option>Slovenia</option>
                <option>Solomon Islands</option>
                <option>Somalia</option>
                <option>South Africa</option>
                <option>South Georgia</option>
                <option>Spain</option>
                <option>Sri Lanka</option>
                <option>Sudan</option>
                <option>Suriname</option>
                <option>Svalbard</option>
                <option>Swaziland</option>
                <option>Sweden</option>
                <option>Switzerland</option>
                <option>Syrian Arab Republic</option>
                <option>Taiwan</option>
                <option>Tajikista</option>
                <option>Tanzania</option>
                <option>Thailand</option>
                <option>Togo</option>
                <option>Tokelau</option>
                <option>Tonga</option>
                <option>Trinidad and Tobago</option>
                <option>Tunisia</option>
                <option>Turkey</option>
                <option>Turkmenistan</option>
                <option>Turks and Caicos Islands</option>
                <option>Tuvalu</option>
                <option>Uganda</option>
                <option>Ukraine</option>
                <option>United Arab Emirates</option>
                <option>Uruguay</option>
                <option>Uzbekistan</option>
                <option>Vanuatu</option>
                <option>Vatican City State</option>
                <option>Venezuela</option>
                <option>Vietnam</option>
                <option>Virgin Islands</option>
                <option>Wales</option>
                <option>Western Sahara</option>
                <option>Yemen</option>
                <option>Yugoslavia</option>
                <option>Zaire</option>
                <option>Zambia</option>
                <option>Zimbabwe</option>
    </select>*</font></b></td>
  </tr>
  <tr>
    <td width="884" bgcolor="#0E6B97" height="23" colspan="2" bordercolor="#0099CC">
    <p align="center"><font face="Verdana" color="#FFFFFF"><b>More Information</b></font></td>
    </tr>
  <tr>
    <td width="293" bgcolor="#5C5CA8" height="23" bordercolor="#0099CC">
    &nbsp;</td>
    <td width="585" height="23" bgcolor="#E9E9E9">
    &nbsp;</td>
    </tr>
  <tr>
    <td width="293" bgcolor="#5C5CA8" height="23" bordercolor="#0099CC">
    <b><font color="#FFFFFF">Upload your CV</font></b></td>
    <td width="585" height="23" bgcolor="#E9E9E9">
    <b>To Upload your CV, Please <a href="uploadform.asp">Click Here</a></b></td>
    </tr>
  <tr>
    <td width="293" bgcolor="#5C5CA8" height="23" bordercolor="#0099CC">
    <font color="#FFFFFF"><b>Current Fee Rate (Approx):&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    </b>&nbsp;&nbsp;&nbsp; &nbsp;</font></td>
    <td width="585" height="23" bgcolor="#E9E9E9">
    <font color="#5C5CA8"><select size="1" name="D1">
	<option selected></option>
        <option>£50 to £100</option>
        <option>£100 to £150</option>
        <option>£150 to £200</option>
        <option>£200 to £250</option>
        <option>£250 to £300</option>
        <option>£300 to £350</option>
        <option>£350 to £400</option>
        <option>Greater than £400</option>
      </select>	</select> *</font></td>
    </tr>
  <tr>
    <td width="293" bgcolor="#5C5CA8" height="23" bordercolor="#0099CC">
    <font color="#FFFFFF"><b>Are you entitled to work in the UK?:</b></font></td>
    <td width="585" height="23" bgcolor="#E9E9E9">
    <input type="radio" value="V1" name="R1" checked>Yes <input type="radio" value="V2" name="R1">No&nbsp;<font color="#5C5CA8">
    **&nbsp;&nbsp;&nbsp;&nbsp;</font></td>
  </tr>
  <tr>
    <td width="293" bgcolor="#5C5CA8" height="23" bordercolor="#0099CC">
    <font color="#FFFFFF"><b>Assignment Preferences:</b></font></td>
    <td width="585" height="23" bgcolor="#E9E9E9"> 
    <font color="#5C5CA8">Please State whether you would prefer temporary or permanent
    contract/s.</font>
    <p><input type="radio" name="R1" value="V3">Temporary&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    Please State a suitable contract term. <input type="text" name="T1" size="10" value="(In Months)"></p>
    <p><input type="radio" name="R1" value="V4">Permanent</p>
    </td>
  </tr>
  <tr>
    <td width="385" bgcolor="#5C5CA8" height="1" bordercolor="#0000FF">
      <font color="#FFFFFF"><b>Your Previous Project Experience</b></font>


    </td>
  </tr>
  <tr>
    <td width="385" bgcolor="#0099CC" height="1" bordercolor="#5C5CA8">
      <p align="right">
<input type=button value="Add Another" onClick="addRow()" name="AddProjectExp">


    </td>
  </tr>
  </table>
  <table border="2" bordercolor="#5C5CA8" width="869" height="104">
<td height="98">
<table BORDER=1 height="44">
    <tr id=baseRow>
        <td height="38" align="left">Start Date
          <p><input name="JobDateStart" size="8" value="mm/yyyy"></p>
        </td>
        <td height="38" align="left">End Date
          <p><input name="JobDateFinish" size="8" value="mm/yyyy"></p>
        </td>
        <td height="38" align="left">Organisation Name
          <p><input name="EmployerName" size="25"></p>
        </td>
        <td height="38" align="left">Your Role
          <p><textarea rows="3" name="S1" cols="23"></textarea></p>
        </td>
        <td height="38" align="left">More Detail
          <p><textarea rows="3" name="S2" cols="22"></textarea></p>
        </td>
        <td height="38" align="left">
          <p align="center">Not Deletable


          </p>
        </td>
    </tr>
</table>
<p align="right">


<script language=javascript>
    rowCount = 1
    function addRow(){
        rowCount ++
        newRow = document.getElementById("baseRow").cloneNode(true)
        newRow.childNodes[0].childNodes[1].name = "JobDateStart" + rowCount    //first input in first cell
        newRow.childNodes[0].childNodes[1].value = ""
        newRow.childNodes[1].childNodes[1].name = "JobDateFinish" + rowCount    //first input in second cell
        newRow.childNodes[1].childNodes[1].value = ""
        newRow.childNodes[2].childNodes[1].name = "EmployerName" + rowCount    //first input in third cell
        newRow.childNodes[2].childNodes[1].value = ""
        newRow.childNodes[3].childNodes[1].name = "JobRole" + rowCount    //first input in fourth cell
        newRow.childNodes[3].childNodes[1].value = ""
        newRow.childNodes[4].childNodes[1].name = "JobDetails" + rowCount    //first input in fifth cell
        newRow.childNodes[4].childNodes[1].value = ""
        newRow.id = "row" + rowCount
        newButton = document.createElement("input")
        newButton.id = "button" + rowCount
        newButton.type = "button"
        newButton.value = "Delete"
        newButton.attachEvent("onclick", deleteRow)
        newRow.childNodes[5].childNodes[0].replaceNode(newButton) 
        
        document.getElementById("baseRow").parentNode.appendChild(newRow)
    }
    
    function deleteRow(){
        buttonID = event.srcElement.id        // ie - "button2"
        rowID = buttonID.substr(6)            // ie - "2"
        document.getElementById("row" + rowID).removeNode(true)
    }
</script>
</tr>
</td>
  </table>
  <table border="2" bordercolor="#5C5CA8" width="869" height="66">
<table BORDER=1 height="44">
    <tr id=baseRow>
        <td height="38">Start Date
          <p><input name="JobDateStart" size="8" value="mm/yyyy"></p>
        </td>
        <td height="38">End Date
          <p><input name="JobDateFinish" size="8" value="mm/yyyy"></p>
        </td>
        <td height="38">Organisation Name
          <p><input name="EmployerName" size="25"></p>
        </td>
        <td height="38">Your Role
          <p><textarea rows="3" name="S1" cols="23"></textarea></p>
        </td>
        <td height="38">More Detail
          <p><textarea rows="3" name="S2" cols="22"></textarea></p>
        </td>
        <td height="38">
          <p align="center">Not Deletable</p>
        </td>
    </tr>
</table>
<p align="right">
<input type=button value="Add Another Job Experience" onClick="addRow()" name="AddJobExp">


<p align="right">&nbsp;


<script language=javascript>
    rowCount = 1
    function addRow(){
        rowCount ++
        newRow = document.getElementById("baseRow").cloneNode(true)
        newRow.childNodes[0].childNodes[1].name = "JobDateStart" + rowCount    //first input in first cell
        newRow.childNodes[0].childNodes[1].value = ""
        newRow.childNodes[1].childNodes[1].name = "JobDateFinish" + rowCount    //first input in second cell
        newRow.childNodes[1].childNodes[1].value = ""
        newRow.childNodes[2].childNodes[1].name = "EmployerName" + rowCount    //first input in third cell
        newRow.childNodes[2].childNodes[1].value = ""
        newRow.childNodes[3].childNodes[1].name = "JobRole" + rowCount    //first input in fourth cell
        newRow.childNodes[3].childNodes[1].value = ""
        newRow.childNodes[4].childNodes[1].name = "JobDetails" + rowCount    //first input in fifth cell
        newRow.childNodes[4].childNodes[1].value = ""
        newRow.id = "row" + rowCount
        newButton = document.createElement("input")
        newButton.id = "button" + rowCount
        newButton.type = "button"
        newButton.value = "Delete"
        newButton.attachEvent("onclick", deleteRow)
        newRow.childNodes[5].childNodes[0].replaceNode(newButton) 
        
        document.getElementById("baseRow").parentNode.appendChild(newRow)
    }
    
    function deleteRow(){
        buttonID = event.srcElement.id        // ie - "button2"
        rowID = buttonID.substr(6)            // ie - "2"
        document.getElementById("row" + rowID).removeNode(true)
    }
</script>
</tr>
</td>
</table>

<p>* <a onclick = "stat();">Require Fields</a></p>

<p><font color="#5C5CA8">** Due to EAA Regulations (2003), we will be required
by law to collect NI/Passport/Work Permit details from all candidates at a later
stage</font></p>

<hr>
<p>
    <textarea rows="8" name="Agreement" cols="80">LOADING AGREEMENT....
</textarea>
    </p>
<p>
    <font face="Verdana">
	<input type="checkbox" name="agree" value="true" style="font-weight: 700"></font><b><font size="2" face="Verdana">I 
	have read all terms and Conditions. I agree to the User Agreement.</font></b></p>
<p>
<font size="2" face="Arial">

    Confirmation Code :
	<img src="captcha/captcha.asp?token=<%= Encrypt(strSecurityCode,strSecurityKey) %>&cryptKey=<%= strSecurityKey %>" border="3" />&nbsp;&nbsp;&nbsp; 
	</font><font size="4" face="Arial">

    &#9658;
	</font><font size="2" face="Arial">

    (Enter confirmation code left to Arrow)</font><font face="Arial"><font size="2">

    :
	</font>
	<input type="text" name="key_ent" size="11" maxlength="6"></font><br>
</p>


<p><input type="submit" value="Submit &gt;&gt;" onclick = "stat();"> 
<input type="button" value="Disagree &amp; Back" onClick="history.go(-1)"> <input type="reset" value=" Reset "></p>
<input type="hidden" name="cryptKey" value="<%= strSecurityKey %>">
<input type="hidden" name="token" value="<%= Encrypt(strSecurityCode,strSecurityKey) %>">
</form>

</body>

</html>
<%
Function Encrypt(Uncoded, Password)
    Uncoded = Swap(Uncoded)                            'Run the text through the swap function
    
    For Char = 1 to LEN(Uncoded)
      TxtChar = ASC(MID(Uncoded, Char, 1))             'Store character codes of text and password
      PwdChar = ASC(MID(Password, (Char MOD LEN(Password) + 1), 1))

      NewChar = TxtChar + PwdChar                      'Combine them into one new character code
      If NewChar > 255 Then NewChar = NewChar - 255    'Charactercode can't be >255 or <1 
      
      Encrypt = Encrypt & Chr(NewChar)                 'Add new charactercode
    Next
    
    Uncoded = Swap(Uncoded)                            'back-swap the text so it will be displayed correctly (not necessary for successful encryption)
  End Function
   
  Function Swap(Inp)
    Dim InpTemp(3)                                     'Make array with 4 positions
    
    For Char = 1 to LEN(Inp) step 4                    'Walk through the string
	  
	  if Char + 2 < LEN(Inp) then                      'If there are enough characters left to do a swap
	    
	    for i = 0 to 3                                 
	      InpTemp(i) = MID(Inp, Char + i, 1)           'Store 4 characters in array
        next
        
        if LEN(Inp) MOD 4 > 1 then                     'I used two ways of swapping (for extra security), it depends on the length of the string wich swap will be done
          Outp = Outp & InpTemp(2) & InpTemp(3) & InpTemp(0) & InpTemp(1)
        else
		  Outp = Outp & InpTemp(3) & InpTemp(2) & InpTemp(1) & InpTemp(0)
	    end if
	  
	  else
	    Outp = Outp & MID(Inp, Char, LEN(Inp) - Char + 1)   'If swap couldn't be made, just add the remaining characters
	  end if
    
    Next
    
    Swap = Outp                                        'Return the swapped string
  End Function
%>
 
hi all...

i'm a beginner ....
i try it on firefox browser..
it does not work...why?
 

removeNode is IE-only. The code would need to be reworked to use removeChild instead.

Hope this helps,
Dan


[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top