Post to TEXTAREA question...

liunx

Guest
Hi,<br />
<br />
I know this is probably simple, but it's after midnight here and not had much sleep so before i go mental, lol...<br />
<br />
I'm trying to post a customers address from a hidden field (in a shopping cart) to a TEXTAREA field on a form via the Payment gateway, but been racking my brains to why i can't seem to post a character return.<br />
<br />
I've tried "%0D" but didn't work, it just shows up in the TEXTAREA with the rest of the address, any ideas?<br />
<br />
:confused:<!--content-->it should be dairly simple...<br />
<br />
document.formName.textAreaName.value= ="any value"<br />
if this is not working then you might need to post your code here so that some one can a take a look..<!--content-->have you tried vbcrlf ?<!--content-->no sorry tried that too,<br />
<br />
even tried \n even thought it's perl, lol... looks like i'll have to stick with everything on 1 line by the looks of it then :-/<br />
<br />
Thanks anyway,<br />
Paul<br />
<br />
------------<br />
the code used at the moment:<br />
<INPUT type=hidden name="description" value="<%=name%>&nbsp; <%=lastName%>,&nbsp;<%=address%>,&nbsp;<%=city%>,&nbsp;<%=stateCode%>,&nbsp;<%=zip%>&nbsp;<%=phone%>&nbsp;<%=email%>"><br />
<br />
This puts all the information on one line, but i would prefer to have address, etc on a seperate line, if thats any help?<!--content-->I am nost sure what are you doing incorrect,but here is the code I know works for both NS6+ and IE6+<br />
<br />
<script type="text/javascript"><br />
function Process(){<br />
var tarea = document.form1.ta;<br />
tarea.value="Value 1\nValue 2\nValue 3"<br />
}<br />
</script><br />
</head><br />
<br />
<body class="body"><br />
<form name="form1" action="" onsubmit=""><br />
<textarea name="ta"></textarea><br />
<input type="Button" value="process" onclick="Process()"/><br />
</form><!--content-->I use:<br />
<br />
strtextcode = replace(replace(request.form("text"), vbcrlf, "<br>"), "'", "^")<br />
<br />
when inserting the customers record into the database so when I select the record from the database and write it out into another text area, I just reverse the replace functions and all is well.<br />
<br />
Thus:<br />
<br />
<textarea cols="78" rows="4" name="text" class="newbody"><%=replace(replace(rscontent("contenttext"), "^", "'"), "<br>", vbcrlf)%></textarea><br />
<br />
Hope this helps.<br />
<br />
<br />
bloke<br />
blokeinthekitchen.com<!--content-->
 
Back
Top