This topic is locked

Word Count

9/28/2006 3:46:47 PM
PHPRunner General questions
B
bbanks author

Does anyone know how to add a word count to update a field called totalwords
I have added code to the xxx_edit.php page that is counting the words in a comment box.
However I would like to store the word count of the comments box in the field called totalwords.
Any Idea how to get it in there would be appreciated. It would even be better if it could be done on the xxx_add.php page. Here is the code I added.
<?php

$strText = $row_Qualifed['comment'];

$wordcount = count(explode(" ",$strText))-1;

echo " $wordcount ";

?>

Alexey admin 9/29/2006

Bart,
just put this code into Before record added and Before record updated events in PHPRunner.

strText = $values['comment'];

$wordcount = count(explode(" ",$strText))-1;

$values["totalwords"]= $wordcount;

B
bbanks author 9/29/2006

Thank you that works great!

Bart,

just put this code into Before record addedand Before record updated events in PHPRunner.