Skip to content

🔥 The free & Open Source DocuSign alternative

fix: text input validation issue if user not select any validation or free user also

RaktimaNXGcb6d9e9b9beb
diff --git a/apps/OpenSign/src/components/pdf/PlaceholderType.js b/apps/OpenSign/src/components/pdf/PlaceholderType.js
index b20f6ea2f..15d911251 100644
--- a/apps/OpenSign/src/components/pdf/PlaceholderType.js
+++ b/apps/OpenSign/src/components/pdf/PlaceholderType.js
@@ -40,7 +40,7 @@ function PlaceholderType(props) {
const validateExpression = (regexValidation) => {
if (textValue) {
let regexObject = regexValidation;
- if (props.pos?.options.validation.type === "regex") {
+ if (props.pos?.options?.validation?.type === "regex") {
regexObject = RegexParser(regexValidation);
}
// new RegExp(regexValidation);
@@ -89,11 +89,11 @@ function PlaceholderType(props) {
case "number":
setValidatePlaceholder("12345");
break;
- case textInputWidget:
- setValidatePlaceholder("enter text");
+ case "text":
+ setValidatePlaceholder("please enter text");
break;
default:
- setValidatePlaceholder("enter text");
+ setValidatePlaceholder("please enter value");
}
}
@@ -407,7 +407,7 @@ function PlaceholderType(props) {
(props.isNeedSign && props.data?.signerObjId === props.signerObjId) ? (
<textarea
ref={inputRef}
- placeholder={validatePlaceholder}
+ placeholder={validatePlaceholder || "please enter value"}
rows={1}
onKeyDown={handleEnterPress}
value={textValue}
@@ -710,7 +710,7 @@ function PlaceholderType(props) {
(props.isNeedSign && props.data?.signerObjId === props.signerObjId) ? (
<textarea
ref={inputRef}
- placeholder={"email"}
+ placeholder={"enter email"}
rows={1}
onKeyDown={handleEnterPress}
value={textValue}
@@ -782,7 +782,7 @@ function PlaceholderType(props) {
case textWidget:
return (
<textarea
- placeholder="Enter label"
+ placeholder="Enter text"
rows={1}
onKeyDown={handleEnterPress}
value={textValue}
diff --git a/apps/OpenSign/src/components/pdf/WidgetNameModal.js b/apps/OpenSign/src/components/pdf/WidgetNameModal.js
index baaadadba..7bafe12ac 100644
--- a/apps/OpenSign/src/components/pdf/WidgetNameModal.js
+++ b/apps/OpenSign/src/components/pdf/WidgetNameModal.js
@@ -13,7 +13,7 @@ const WidgetNameModal = (props) => {
defaultValue: "",
status: "required",
hint: "",
- textvalidate: "text"
+ textvalidate: ""
});
const [isValid, setIsValid] = useState(true);
const statusArr = ["Required", "Optional"];
@@ -48,7 +48,7 @@ const WidgetNameModal = (props) => {
defaultValue: "",
status: "required",
hint: "",
- textvalidate: "text"
+ textvalidate: ""
});
}
};
@@ -82,7 +82,7 @@ const WidgetNameModal = (props) => {
function handleBlurRegex() {
if (!formdata.textvalidate) {
- setFormdata({ ...formdata, textvalidate: "text" });
+ setFormdata({ ...formdata, textvalidate: "" });
} else {
if (formdata.defaultValue) {
const regexObject = RegexParser(
diff --git a/apps/OpenSign/src/constant/Utils.js b/apps/OpenSign/src/constant/Utils.js
index 5214997a9..fb7f7309f 100644
--- a/apps/OpenSign/src/constant/Utils.js
+++ b/apps/OpenSign/src/constant/Utils.js
@@ -323,15 +323,15 @@ export const addWidgetOptions = (type) => {
options: { isReadOnly: false, isHideLabel: false }
};
case textInputWidget:
- return { ...defaultOpt, validation: { type: "text", pattern: "" } };
+ return { ...defaultOpt };
case "initials":
return defaultOpt;
case "name":
- return { ...defaultOpt, validation: { type: "text", pattern: "" } };
+ return { ...defaultOpt };
case "company":
- return { ...defaultOpt, validation: { type: "text", pattern: "" } };
+ return { ...defaultOpt };
case "job title":
- return { ...defaultOpt, validation: { type: "text", pattern: "" } };
+ return { ...defaultOpt };
case "date":
return {
...defaultOpt,
diff --git a/apps/OpenSign/src/pages/PlaceHolderSign.js b/apps/OpenSign/src/pages/PlaceHolderSign.js
index e7328ed0d..cd11a1c03 100644
--- a/apps/OpenSign/src/pages/PlaceHolderSign.js
+++ b/apps/OpenSign/src/pages/PlaceHolderSign.js
@@ -1375,10 +1375,7 @@ function PlaceHolderSign() {
inputype = options.includes(defaultdata.textvalidate)
? defaultdata.textvalidate
: "regex";
- } else {
- inputype = "text";
}
-
const filterSignerPos = signerPos.filter((data) => data.Id === uniqueId);
if (filterSignerPos.length > 0) {
const getPlaceHolder = filterSignerPos[0].placeHolder;
@@ -1401,11 +1398,14 @@ function PlaceHolderSign() {
status: defaultdata?.status || "required",
hint: defaultdata?.hint || "",
defaultValue: defaultdata?.defaultValue || "",
- validation: {
- type: inputype,
- pattern:
- inputype === "regex" ? defaultdata.textvalidate : ""
- }
+ validation:
+ (isSubscribe || !isEnableSubscription) && inputype
+ ? {
+ type: inputype,
+ pattern:
+ inputype === "regex" ? defaultdata.textvalidate : ""
+ }
+ : {}
}
};
} else {
@@ -1695,7 +1695,10 @@ function PlaceHolderSign() {
style={{ padding: 20 }}
>
{isSendAlert.mssg === "sure" ? (
- <span>Please add at least one signature field for all recipients.</span>
+ <span>
+ Please add at least one signature field for all
+ recipients.
+ </span>
) : isSendAlert.mssg === textWidget ? (
<p>Please confirm that you have filled the text field.</p>
) : (