-
Why this code doesn't work?
<script language="VBScript">
Function ReplaceCR(patrn, replStr)
Dim str, jobPostForm
Set jobPostForm = document.forms("JobForm")
str = jobPostForm.JD.value
MsgBox(str)
ReplaceCR = Replace(str, patrn, replStr)
End Function
MsgBox(ReplaceCR(chr(32), "<br><br>"))
</script>
I don't understand why this code doesn't work...
*JD is a textareaI have in the form...
I am trying to get the value of JD field, and replace all the space with
<BR><BR>... for some reason this is not working...
Thanks!
-
Re: Why this code doesn't work?
If an element is inside a form, you have to reference as a form element:
jobpostform.elements("JD").value
Try that and see if it works.
steve
"Larry" <larry@levelogic.com> wrote in message
news:3974dd13$1@news.devx.com...
>
> <script language="VBScript">
> Function ReplaceCR(patrn, replStr)
> Dim str, jobPostForm
> Set jobPostForm = document.forms("JobForm")
> str = jobPostForm.JD.value
> MsgBox(str)
> ReplaceCR = Replace(str, patrn, replStr)
> End Function
>
> MsgBox(ReplaceCR(chr(32), "<br><br>"))
> </script>
>
> I don't understand why this code doesn't work...
> *JD is a textareaI have in the form...
> I am trying to get the value of JD field, and replace all the space with
> <BR><BR>... for some reason this is not working...
> Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks