Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <xp:button id="save_part_btn" value="+Add" style="float:right;">
- <xp:eventHandler event="onclick" submit="true"
- refreshMode="complete">
- <xp:this.action><![CDATA[#{javascript:
- /*
- var estdoc:NotesDocument=database.getDocumentByUNID(doc_source.getDocument().getParentDocumentUNID())
- var estPartdoc:NotesDocument=estdoc.getParentDatabase().createDocument()
- Ignore it
- estPartdoc.replaceItemValue('Form','Estimate_Cost_Part')
- estPartdoc.replaceItemValue('Predoc',estdoc.getUniversalID())
- estPartdoc.replaceItemValue('$OSN_IsSaved','1')
- */
- estPartdoc.replaceItemValue('TSNB_All',getComponent('input_tsnb_all').getValue())
- }]]></xp:this.action>
- <xp:this.script><![CDATA[
- var isValid = true;
- var result = "";
- function isStringEmpty(string2Check)
- {
- return string2Check == "" || string2Check[0] == " ";
- }
- function isNumberCorrect(number2Check)
- {
- return /^[1-9]d*(,d{1,3})?$/.test(number2Check.toString());
- }
- if(isStringEmpty(document.getElementById("#{id:input_tsnb_all}").value))
- {
- wholeValid = false;
- result += '-The field cannot be emptyn'
- }
- else if(!isNumberCorrect(document.getElementById("#{id:input_tsnb_all}").value))
- {
- wholeValid = false;
- result += '-The field is not correctn'
- }
- if(!isValid)
- alert(result)
- return isValid;
- ]]></xp:this.script>
- </xp:eventHandler>
- </xp:button>
Add Comment
Please, Sign In to add comment