fjerne to felt i en form
jeg har en form med flere felt, når ønsker jeg å fjerne "navn", "telefon", og "email".problemet er at da må jeg også endre i javascriptet og jeg får bare feilmeldinger når jeg prøver.
Kan noen hjelpe, her er koden:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="config.asp" -->
<%
theDate = request.QueryString("d")
Session.LCID = intLocale
' check if selected date occurs in the past */
dNow = FormatDateTime(Date(),vbShortDate)
if DateDiff("d", dNow, theDate) <= -1 Then
%>
<script language="JavaScript">
alert('<%=strPopup%>');
</script>
<%
end if
%>
<html>
<head>
<title>Add Appointment</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="styles.css" type="text/css">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function YY_checkform() { //v4.66
//copyright (c)1998,2002 Yaromat.com
var args = YY_checkform.arguments; var myDot=true; var myV=''; var myErr='';var addErr=false;var myReq;
for (var i=1; i<args.length;i=i+4){
if (args[i+1].charAt(0)=='#'){myReq=true; args[i+1]=args[i+1].substring(1);}else{myReq=false}
var myObj = MM_findObj(args[i].replace(/\[\d+\]/ig,""));
myV=myObj.value;
if (myObj.type=='text'||myObj.type=='password'||myObj.type=='hidden'){
if (myReq&&myObj.value.length==0){addErr=true}
if ((myV.length>0)&&(args[i+2]==1)){ //fromto
var myMa=args[i+1].split('_');if(isNaN(myV)||myV<myMa[0]/1||myV > myMa[1]/1){addErr=true}
} else if ((myV.length>0)&&(args[i+2]==2)){
var rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-z]{2,4}$");if(!rx.test(myV))addErr=true;
} else if ((myV.length>0)&&(args[i+2]==3)){ // date
var myMa=args[i+1].split("#"); var myAt=myV.match(myMa[0]);
if(myAt){
var myD=(myAt[myMa[1]])?myAt[myMa[1]]:1; var myM=myAt[myMa[2]]-1; var myY=myAt[myMa[3]];
var myDate=new Date(myY,myM,myD);
if(myDate.getFullYear()!=myY||myDate.getDate()!=myD||myDate.getMonth()!=myM){addErr=true};
}else{addErr=true}
} else if ((myV.length>0)&&(args[i+2]==4)){ // time
var myMa=args[i+1].split("#"); var myAt=myV.match(myMa[0]);if(!myAt){addErr=true}
} else if (myV.length>0&&args[i+2]==5){ // check this 2
var myObj1 = MM_findObj(args[i+1].replace(/\[\d+\]/ig,""));
if(myObj1.length)myObj1=myObj1[args[i+1].replace(/(.*\[)|(\].*)/ig,"")];
if(!myObj1.checked){addErr=true}
} else if (myV.length>0&&args[i+2]==6){ // the same
var myObj1 = MM_findObj(args[i+1]);
if(myV!=myObj1.value){addErr=true}
}
} else
if (!myObj.type&&myObj.length>0&&myObj[0].type=='radio'){
var myTest = args[i].match(/(.*)\[(\d+)\].*/i);
var myObj1=(myObj.length>1)?myObj[myTest[2]]:myObj;
if (args[i+2]==1&&myObj1&&myObj1.checked&&MM_findObj(args[i+1]).value.length/1==0){addErr=true}
if (args[i+2]==2){
var myDot=false;
for(var j=0;j<myObj.length;j++){myDot=myDot||myObj[j].checked}
if(!myDot){myErr+='* ' +args[i+3]+'\n'}
}
} else if (myObj.type=='checkbox'){
if(args[i+2]==1&&myObj.checked==false){addErr=true}
if(args[i+2]==2&&myObj.checked&&MM_findObj(args[i+1]).value.length/1==0){addErr=true}
} else if (myObj.type=='select-one'||myObj.type=='select-multiple'){
if(args[i+2]==1&&myObj.selectedIndex/1==0){addErr=true}
}else if (myObj.type=='textarea'){
if(myV.length<args[i+1]){addErr=true}
}
if (addErr){myErr+='* '+args[i+3]+'\n'; addErr=false}
}
if (myErr!=''){alert('The required information is incomplete or contains errors:\t\t\t\t\t\n\n'+myErr)}
document.MM_returnValue = (myErr=='');
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form action="save.asp" method="post" name="f1" id="f1">
<table width="100%" cellspacing="0" cellpadding="1" style="border:solid 1px black">
<tr>
<td> <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#999999">
<tr bgcolor="#CCCCCC">
<td colspan="2" class="heading">Add Appointment</td>
</tr>
<tr>
<td width="12%" bgcolor="#CCCCCC" class="txt">Subject:</td>
<td width="88%" bgcolor="#F8F8F8" class="txt"><input name="subject" type="text" id="subject" size="60"></td>
</tr>
<tr valign="top">
<td bgcolor="#CCCCCC" class="txt">Time:</td>
<td bgcolor="#F8F8F8" class="txt"> <strong><%=theDate%></strong> at
<select name="time" id="time">
<option value="none">select time</option>
<%
strTmpFromTime = theDate&" "&strOpTime
strTmpToTime = theDate&" "&strClTime
strTotalMinutes = DateDiff("n", strTmpFromTime,strTmpToTime )
y = 60
x = Cint(strTotalMinutes)
strOutPut = strOpTime
strOutPut = FormatDateTime(strOutput,vbShortTime)
Do While y < x+60
z = y + x
%>
<option value="<%=strOutput%>"><%=strOutput%></option>
<%
y = y + strInterVal
strOutPut = DateAdd("n",strInterVal,strOutPut)
strOutPut = FormatDateTime(strOutput,vbShortTime)
Loop
%>
</select>
<input name="theDate" type="hidden" id="theDate" value="<%=theDate%>"></td>
</tr>
<tr valign="top">
<td height="120" bgcolor="#CCCCCC" class="txt">Body:</td>
<td height="120" bgcolor="#F8F8F8" class="txt"><textarea name="body" cols="58" rows="9" wrap="VIRTUAL" id="body"></textarea></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="1" cellspacing="0" class="txt">
<tr>
<td bgcolor="#CCCCCC">Name:</td>
</tr>
<tr>
<td bgcolor="#F8F8F8"><input name="name" type="text" id="name" size="36"></td>
</tr>
<tr>
<td bgcolor="#999999" height="1"></td>
</tr>
<tr>
<td bgcolor="#CCCCCC">telephone:</td>
</tr>
<tr>
<td bgcolor="#F8F8F8"><input name="tel" type="text" id="tel" size="36"></td>
</tr>
<tr>
<td bgcolor="#999999" height="1"></td>
</tr>
<tr>
<td bgcolor="#CCCCCC">Email:</td>
</tr>
<tr>
<td bgcolor="#F8F8F8"><input name="email" type="text" id="email" size="36">
<input name="action" type="hidden" id="action" value="insert"></td>
</tr>
<tr>
<td bgcolor="#F8F8F8"></td>
</tr>
<tr>
<td bgcolor="#F8F8F8">
<input name="Submit" type="submit" onClick="YY_checkform('f1','subject','#q','0','Subject is required','name','#q','0','Name is required','email','#S','2','Email is required, must be a valid email address','time','#q','1','Appointment time must be selected');return document.MM_returnValue" value="Submit">
<input type="button" name="button" value="Cancel" onClick="self.close()"></td>
</tr>
</table></td>
</tr>
</table>
</form>
</body>
</html>