HTML Code In A Textarea
is there any way to indent HTML code inside a simple textarea?
View Repliesis there any way to indent HTML code inside a simple textarea?
View RepliesI am trying to do a check to see if a value of one of my fields is a certain number. If it is I want to display a form text entry box, if not skip it.
I want to put a value of another field in the text entry box so the user can edit/update the info. I have the code to display or not display, but when I try to display the value in the text entry field, I get quotes around it. Code:
One of my client requires a technical test with 15 questions, one of the question is given below: Write the code to access the name element in the XML example below.
<XML ID=MyXMLDocument>
<class>
<student studentID=13429>
<name>Jane Smith</name>
<average>65</average>
</student>
</class>
</XML>
-------------------------------------------------------------
The candidate has to write the code for the above giveb question in the textarea box, and since the code contains html tags , i have been facing problems in retrieveing the data from the textareabox in the exact manner has entered by the candidate.
Is there any solution to retrieve the exact code with the html tags.
I use a script (tableEditor, this forum recommended it) that if viewing a TEXT field with HTML in it... gets all funky.
one of the data fields vachar contains the center of a page... okay if you pullig it just to display it but imopssable to edit it again or view it in any form other than a striaght pull to a page.
when i go to edit a page with the online editor (using <textarea> to display the code) that has </text area> in it it ends the FORM im view TEXT area and then goes on to display the code...
i have built an interface for template making. i am using a simple form with a text area and submit button to save the code, i want to show in a template page, into the database.
I also use the same textare to view any code saved to the database for a specific page.
THE PROBLEM - i have to save a
response.write("<textarea..............></textarea>")
the minute i paste it into the textarea it saves it fine but shows it wrong as if once it reads the </textarea> in my saved code the main page 'closes' the main textarea . i.e. the rest of my saved code is shown as part of the page - and its not pretty!
I'm doing a content management system, whereby the user can enter the HTML code for a currency symbol, eg £ for £.y . when I bring this data backup, say they want to edit the settings, then my ASP/HTML page is rendering the HTML code, eg £, rather than showing the original value, eg £.
If for example I put a space between the '&' and the 'pound;', eg & pound; then this will cause me problems because the user will think that they have to a put a space in or they file it with the space, which means the HTML code won't work any more. Is there a way round this?
I am designing an Interactive website that uses MySql. At the moment I have just designed the Login pages for users. However to do this I have a Login.html page and a Login.asp page. The values from the html form is posted to the asp page which checks the details against the databse and redirects the user acordingly.
However I would like to have just one Login.asp page where this is all done in. I have tried simply putting the html code into the asp page but the problem is that as soon as i run the login.asp page (on IIS), the asp code is also run. How can I change this so that only once the user clicks on the submit form button, only then the asp code is executed?
I'm looking for asp or java script that encrypt html
code. That it will confuse some surffers that trying
to steal content.
I have creating a simple ASP guestbook using an Access Database, is there any of disabling HTML code so that visitors cant post HTML in the guestbook entries?
View Replies View RelatedHow do you put an asp code inside an html tag?
This is not working:
<a href="contact.asp?subject=Question about group
<%=(Recordset1.Fields.Item("group_name").Value)%>">Send a message</a>
I am actually putting above info in an Access field. People would be able to send me email through a form in contact.asp and I want the subject line reflect which page they came from.
So, when my search returns the result I need one of the fields to be clickable and show the customer's info for the clicked customer.So, lets say we make the ID clickable.
So, my HTML has to look like:Code:
<input type = "submit" value="sqlrs("ID")">
How do I construct that in ASP since, using " in strings ends it and same with Response.write methods.
How would I insert this code into a .HTML document rather than a .ASP document.
<%
Set MyFileObj = Server.CreateObject("Scripting.FileSystemObject")
Set MyTextFile = MyFileObj.OpenTextFile(Server.MapPath("content.txt"))
WHILE NOT MyTextFile.AtEndOfStream
Response.Write(MyTextFile.ReadLine & "<BR>")
WEND
MyTextFile.Close
%>
Works fine in .ASP but not .HTML.
im using some wysiwug editor called htmlarea to add some articles to the DB through textarea (something like that we use to add threads) but when the html code contains a link for example it gives error coz of the the ("") in the html tags .. it's something like this Code:
View Replies View Related,I need to call a URL, receive the raw html in my VB Script code and parse it
to retrieve a value from a cgi generated web page on a remote Apache Web
server.
What is the best method to accomplish this in ASP 1.0?
how to dispaly text from a text area on a page as page copy (using the replace function)
How do I display this text inside another textarea, holding formatting? All variations of 'what I thought would work' do not.
I am using the following function:
Function DisplayMemo(theText)
DisplayMemo = ""
on error resume next
DisplayMemo = CStr(theText)
if (len(DisplayMemo) > 0) Then
DisplayMemo = Replace(DisplayMemo, vbCrLf, "<br>", 1, -1, 1)
end if
End Function
calling it like:
<textarea cols=119 name=ownSubmitted rows=7>" & DisplayMemo(getInfo(0)) & "</textarea>
NOTE: getInfo(0) is a variable holding my value. Yes the value is there. It is showing the text I want, however the <br>'s are rendered inside the text area?
I have a page which has a header finding out some variables from request.querystring and other places. Later on in the page in what is normal HTML code I want to use the variable but am having to do this:
<%
response.write "<A Href='" & shopurl & "' target='_blank'>Shop</A>"
%>
is there any way i can just have the line with the variable being interpreted without having to go into a code protect and write the line out with code. Something like this:
<A Href=%shopurl% target="_blank">Shop</A>
How is it you should format your ASP code to that when viewing the resulting
HTML text from the browsers "view code" it looks nice with line breaks?
I have a e-mail function in serverside VB, how would i put html code in the body variable so when email is recieved it looks like html page in the body. right now it just shows up as text in the body of message,
<html><head></head><body><table><tr><td>one</td><td>two</td><td>three</td>
<td>four</td></tr></table></body></html>
There must be a way because i get emails with html ?
inserting dynamic page code in .html page? i.e. i would like to insert a code which will display links. where my homepage link extension is .html. if it is .asp it would have been very easy. and also i would have worked fine. but now the problem is the homepage index file extension is .html.
so if i insert the code it is not displaying the links. i tried inserting the code in a separate file and saved as file.inc and gave the link from home page <!--#include file="file.inc"--> but still the link is not showing and not working.
i have a database and the asp file. my database will have one table, a user table, with various fields like username, password, name...age.. all i need is the html code to make a simple form such as
Welcome to the add user page:
PLease enter a username (input box)
Please enter an email address (input box)
finally a submit button.
i then want the variables to run a 'signup.asp' file which i have, and be placed into a database.
I am writing a small database utility to catalog all of my favorite ASM/JS/VBS functions and scripts on an asp page. Everything is going smoothly except for one thing that I can't quite seem to think my way around.
I am using a <textarea> to display the code but some of my scripts have <textarea> tags in them and when the </textarea> tag is entered, it closes my <textarea> and the rest of the code ends up outside of the textarea.
Example: (the code after the middle </textarea> show up outside of the textarea box)
<textarea>
code...code...code...
code...<textarea></textarea>code...
code...code...code...
</textarea>
I am able to populate the contents of my textares with employees. However when I view it in the browser (IE 6.0), then I see that the 1st employee is aligned towards the right.
Like this: Code:
Emp1
Emp2
Emp3
Emp4
Emp5
How can I ensure that my alignment is is proper? Code:
Simple vbscript,html page loading into access.
Input pg posting to Confirm pg, then sending to access.
when using;
<textarea name="name" tabindex="15">
</textarea>
as an input renders tab spaces automatically.
I took out <Div> tags, and tried nowrap, and tried
reformatting data before sending to dbase (CStr, Trim)
I made a simple <textarea> , but the problem is, everytime I want to press Enter to break row , I gotta put <BR> .. can I do something that the user can type freely and the ASP will insert <BR> where needed?
View Replies View RelatedI have a table having 3 columns. There is a checkbox for each line. I
need to get those lines whose checkboxes are checked, and show those
lines to another webpage. Is there any way to do that? My concern is
that all information in the table are in <tb></tb> pairs without any
name tag. Any idea?
I've written several scenarios where the end user needs to enter data into a textarea (descriptions, messges etc) which becomes part of a form. End users often put apostrophe's and carrige returns in the textarea... however, when the code i write is submitted to the database, it generates an sql command from the page that sent the action.
Client Side:
<form action="somepage.asp" method="post">
<input type="text" name="emailaddress">
<textarea cols="20" rows="5" name="comments"></textarea>
</form>
On code submission...
sql="insert into tableName (email,comments) values ('" & request.form("emailaddress") & "','" & request.form("comments") & "');"
db.execute(sql)
Now, when strange people put carrige returns, it stuffs up the string and therefore produces an error, and to make matters worse if it did recognise a carrige return, it wouldn't be displayed on HTML output. Apostrophes are even worse - they signify the end of a variable in the SQL sentance Can anyone help me and figure out a new way of writing to the DB?
I've got a page on a website I'm developing that contains a textarea.
The textarea will allow users of the site to enter a description of an
item.
When they submit the form that contains the textarea, the textarea and
other form elements data are stored in a database. So far so good.
My problem concerns carriage returns, new lines, line feeds or whatever
else you want to call them :-)
I want them preserved, so when the user wants to edit the description of
the item, the format of the description is displayed exaclty as it was
entered.
The problem is that HTML renders the carriage returns as white space, so
when the database is read and the textarea populated with the
description field, the carriage returns are lost.
I have tried the ASP REPLACE function to replace carriage returns with
<br>, but the code below actually displays all the <br>'s.
<%=Replace(myRecordset.Fields.Item("myField").Value,Chr(13),"<br>")%>
I played around with different combinations of chr(13) and vbcrlf and I
managed to get the textarea to display the description as it was entered
with carriage returns, but upon further testing and editing of the
description, because of the REPLACE function, the number of carriage
returns was doubling each time!
i have 2 tables one table stores the information for the prof and second table stores information for the subject he teaches so first table deptprof has the id,name,email for the professor
so i get his last name and email which is working second table design is name is deptlist
fields are
deptautoid
deptid
subjectname
desc
so one professor might be teaching 3 subjects
so the records in table are
1001
3
maths
maths subject is boring
1002
3
science
science is good
1003
3
sports
make some time for it
so now this page lets the professor update the subject and its desc
so what i do is fill up the subjects and desc he is currently assigned to and then he can change the subjects
and desc
subjects have a checkbox and desc has a textarea
what happens is for example a professor has 3 subjects he is teaching now
so 3 checkboxes are selected and all the desc for them are displayed in the textarea
but now the professor decides he wants to teach 4 subjects
so he selects the 4th subject checkbox and doesnt enter the desc i want to fire the alert
but it doesnt fire the alert
second way prof is teaching 3 subjects
3 checkboxes are selected and 3 textarea are filled
professor decides to delete desc in one of them and hits submit i want to fire an alert
saying he forget desc but it doesnt fire so whenver desc is deleted from the textarea and checkbox for it is selected
i want to fire an alert
can someone tell me whats wrong with the code
thanks,
todd
Code:
<%
getid=trim(request.form("id"))
sqlstr = "SELECT *FROM deptprof WHERE ID = '" & getid & "'"
Set rsdept = Conn.Execute(sqlstr)
getlname=rsdept("LastName")
getemail=rsdept("Email")
rsdept.close
Set rsdept=nothing
sqldeptdetails = "SELECT *FROM deptlist WHERE deptid = '" & getid & "'"
Set rsDetails = Conn.Execute(sqldeptdetails)
%>
<head>
<title>Dept List</title>
<script type="text/javascript">
<!--
function formCheck(formobj)
{
var fieldRequired = Array('LName', 'Email');
var fieldDescription = Array('Last Name', 'Email');
var alertMsg = "You can't submit the form until ALL the mandatory fields have been filled out.
";
alertMsg += '_________________________________________________ ___
'
alertMsg += "Please complete the following fields, then press 'Update dept':
";
var c = 0;
for (var i = 0; i < fieldRequired.length; i++)
{
var obj = formobj.elements[fieldRequired[i]];
document.getElementById(fieldRequired[i]).style.backgroundColor = '#' +'ffffff';
if (obj)
{
switch(obj.type)
{
case 'select':
if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == '')
{
alertMsg += ' - ' + fieldDescription[i] + '
';
document.getElementById(fieldRequired[i]).style.backgroundColor = '#' + 'f8e563';
c++;
}
break;
case 'text':
case 'textarea':
if (obj.value == '' || obj.value == null)
{
alertMsg += ' - ' + fieldDescription[i] + '
';
document.getElementById(fieldRequired[i]).style.backgroundColor = '#' + 'f8e563';
c++;
}
break;
default:
if (obj.value == '' || obj.value == null)
{
alertMsg += ' - ' + fieldDescription[i] + '
';
document.getElementById(fieldRequired[i]).style.backgroudColor = '#' + 'f8e563';
c++;
}
}
}
}
alertMsg += '
These fields have been highlighted for your attention.';
if (c == 0)
{
var strGroupName="rad1";
var checkedCount=0;
for (var i=0; i<document.frm1.elements[strGroupName].length; i++)
{
var curBox=document.frm1.elements[strGroupName][i];
if (curBox.checked)
{
if (document.frm1.elements["txt"+(i+1)].value=='')
{
alertMsg += "Please complete the following fields, then press 'update dept':
";
alertMsg += "You have not entered the value for the "+(i+1)+" Specify desc
";
alert(alertMsg);
document.frm1.elements["txt"+(i+1)].focus(0);
return false;
}
}
}
document.getElementById('submit').value = 'Next...';
return true;
}
else
{
alert(alertMsg);
c = 0;
return false;
}
}
//-->
</script>
</head>
<body>
<form name="frm1" method="post" action="conflist.asp" onsubmit="return formCheck(this);">
<p>Last name:<input type="text" size="32" name="LName" id="LName" value="<%=getlname%>"><br/>
<p>Email:<input type="text" size="32" name="Email" id="Email" value="<%=getemail%>" /><br/>
<table>
<tr>
<th>No</th>
<th>Dept</th>
<th>Desc</th>
</tr>
<tr class="evenrow">
<td>1.</td>
<td><input type="checkbox" name="rad1" value="Maths"
<%
do while not rs.eof
if rsDetails("subjectname") ="Maths" then
Response.Write "checked"
end if
rsDetails.movenext
loop
rsDetails.movefirst
%>
>
Maths</td>
<td><textarea name="txt1" id="txt1" rows="2" cols="35">
<%
Dim rs1,sqlr1,raexp1
raexp1="Maths"
sqlr1 = "SELECT desc FROM deptlist WHERE deptid = '" & getid & "' and subjectname='" & raexp1 & "'"
Set rs1= Conn.Execute(sqlr1)
if not rs1.eof then
%>
<%=rs1("desc")%>
<%
else
End if
rs1.close
Set rs1=nothing
%>
</textarea></td>
</tr>
<tr class="oddrow">
<td>2.</td>
<td><input type="checkbox" name="rad1" value="Science"
<%
do while not rsDetails.eof
if rsDetails("subjectname") ="Science" then
Response.Write "checked"
end if
rsDetails.movenext
loop
rsDetails.movefirst
%>
>Science</td>
<td><textarea name="txt2" rows="2" cols="35">
<%
Dim rs2,sqlr2,raexp2
raexp2="Science"
sqlr2 = "SELECT desc FROM deptlist WHERE deptid = '" & getid & "' and subjectname='" & raexp2 & "'"
Set rs2= Conn.Execute(sqlr2)
if not rs2.eof then
%>
<%=rs2("desc")%>
<%
else
End if
rs2.close
Set rs2=nothing
%>
</textarea></td>
</tr>
<tr class="evenrow">
<td>3.</td>
<td><input type="checkbox" name="rad1" value="sports"
<%
do while not rsDetails.eof
if rsDetails("subjectname") ="sports" then
Response.Write "checked"
end if
rsDetails.movenext
loop
rsDetails.movefirst
%>
>sports</td>
<td><textarea name="txt3" rows="2" cols="35">
<%
Dim rs3,sqlr3,raexp3
raexp3="sports"
sqlr3 = "SELECT desc FROM deptlist WHERE deptid = '" & getid & "' and subjectname='" & raexp3 & "'"
Set rs3= Conn.Execute(sqlr3)
if not rs3.eof then
%>
<%=rs3("desc")%>
<%
Else
End if
rs3.close
Set rs3=nothing
%>
</textarea></td>
</tr>
<tr class="oddrow">
<td>4.</td>
<td><input type="checkbox" name="rad1" value="arts"
<%
do while not rsDetails.eof
if rsDetails("subjectname") ="arts" then
Response.Write "checked"
end if
rsDetails.movenext
loop
rsDetails.movefirst
%>
>arts</td>
<td><textarea name="txt4" rows="2" cols="35">
<%
Dim rs4,sqlr4,raexp4
raexp4="arts"
sqlr4 = "SELECT desc FROM deptlist WHERE deptid = '" & getid & "' and subjectname='" & raexp4 & "'"
Set rs4= Conn.Execute(sqlr4)
if not rs4.eof then
%>
<%=rs4("desc")%>
<%
Else
End if
rs4.close
Set rs4=nothing
%>
</textarea></td>
</tr>
<tr class="evenrow">
<td>5.</td>
<td><input type="checkbox" name="rad1" value="computers"
<%
do while not rsDetails.eof
if rsDetails("subjectname") ="computers" then
Response.Write "checked"
end if
rsDetails.movenext
loop
rsDetails.movefirst
%>
>computers</td>
<td><textarea name="txt5" rows="2" cols="35">
<%
Dim rs5,sqlr5,raexp5
raexp5="computers"
sqlr5 = "SELECT desc FROM deptlist WHERE deptid = '" & getid & "' and subjectname='" & raexp5 & "'"
Set rs5= Conn.Execute(sqlr5)
if not rs5.eof then
%>
<%=rs5("desc")%>
<%
Else
End if
rs5.close
Set rs5=nothing
%>
</textarea></td>
</tr>
</table>
<p><input class="button" type="Submit" id="Submit" value="Update Dept" /><input class="button" type="reset" id="reset" value="Clear" /></p>
<%
Conn.close
Set Conn=Nothing
%>
</form>
</body>
</html>
I am useing "<iframe style="width:650;height:220;overflow:auto;" src="blank.gif" name="IDtemp" id="IDtemp" contentEditable="true"></iframe>"
an i really need to copy selected text from that iframe into
I am trying to display data pulled from a sql db in a text area. The field in the db is of type ntext. I am printing the data using the following code.....
<TEXTAREA name="HTML" COLS=100 ROWS=21>
<%Response.Write(rsCreativeElement("ElementHTML"))%>
</TEXTAREA>
But this is printing as <Long Text>, how can I print the actual data from the db.
Is there a simple way to get the content of my textarea
not encoded !? My text area has comments in it and right
now, I have to replace all encoded characters...
I'm looking for some basic end user textarea formatting, similar to the formatting available when messages are created in this forum, bt even more basic.
I really would like let the user add hyperlinks and to add bolded text without knowing the html tags for these. Any suggestions on where to look for this. Ideally something that would work with all browsers (i.e. including Opera).
I need to create a form with a textarea on an ASP page that, when opened, fills the textarea with the current contents of a field in an Access database, and each time the form is submitted, appends any new text added to the existing text in the database field. I can do this, but the text runs together when it fills the text area. Example:
Entry 1
Entry 2
comes back as
Entry 1Entry 2
Any suggestions on how I can maintain line feeds when I pull the appended field back from the database.