Jump to content
  • 0

Bullets In Text Box


Go to solution Solved by Jan,

Question

7 answers to this question

Recommended Posts

  • 0
  • Solution

I am sorry, this alert allows me to check that tags are inserted.

Please try this code:

<SCRIPT LANGUAGE="JavaScript">
function textReplace()
{
var text = document.getElementById("InsertRecordtest1").value;
text = text.replace(/\n/g, "</li>\n<br/><li>");
text = "<ul><br/><li>"+text+"</li></ul>";
document.getElementById("InsertRecordtest2").value = text;
}
document.getElementById("caspioform").onsubmit=textReplace;
</SCRIPT>
Link to post
Share on other sites
  • 0

Hello ccarls,

 

Do you want to insert tags after the form is submitted?

And do you want to insert tags at the beginning of each line?

Or how do you define the beginning of the sentence? In this case, if I understand correctly, the tags should be inserted after every dot. Is it correct?

Link to post
Share on other sites
  • 0

If possible I would like to insert the tags at submission and post the data to a seperate memo field, so that the email version contains the html format and the original typed text field does not retain the tags. If this is not possible, then generate tags while typing or on submission. I would like the new sentence definition to be based on a new line of text entered, not reliant on a period at end of sentence. The tag should be at the front of each new line of text within the text box.

Link to post
Share on other sites
  • 0

Hello ccarls,

 

If I understand correctly what you want, you can add a Header&Footer element and enter to the Footer the code like following:

<SCRIPT LANGUAGE="JavaScript">


function textReplace()
{
var text = document.getElementById("InsertRecordtext64000").value;
text = text.replace(/\n/g, "</li>\n<br/><li>");
text = "<ul><br/><li>"+text+"</li></ul>";
document.getElementById("InsertRecordtext64").value = text;
}
document.getElementById("caspioform").onsubmit=textReplace;
</SCRIPT>

Please, enter your fields instead of InsertRecordtext64000 and InsertRecordtext64.

 

When a user enters a text to the InsertRecordtext64000 field and press Submit, the text is copied, tags are inserted to it and the text with tags is pasted to the InsertRecordtext64 field.

You can use this field in the email. 

 
If I understand wrongly, please correct me.
 
P.S. I have edited this code too.
Link to post
Share on other sites
  • 0

I think, it is better to create a function. You can try the following code:

<SCRIPT LANGUAGE="JavaScript">
function replacing(text)
{
text = text.replace(/\n/g, "</li>\n<br/><li>");
text = "<ul><br/><li>"+text+"</li></ul>";
return text;
}

function textReplace()
{
document.getElementById("InsertRecordtest1_2").value = replacing(document.getElementById("InsertRecordtest1_1").value);

document.getElementById("InsertRecordtest2_2").value = replacing(document.getElementById("InsertRecordtest2_1").value);

}
document.getElementById("caspioform").onsubmit=textReplace;
</SCRIPT>

I have used two lines like following for every pair of fields, but you can use as many, as you want:

document.getElementById("InsertRecordtest1_2").value = replacing(document.getElementById("InsertRecordtest1_1").value);

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...