Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Java Script Form Validation in Webfocus

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Java Script Form Validation in Webfocus
 Login/Join
 
Gold member
posted
I have a Webfocus HTML form with more than 10 filter Textbox.I want to validate all the text box value using Java Script.

I have written below code.
 
<!-- Generated by Report Layout Painter -->
<HTML>
<HEAD>
<TITLE>HtmlPage</TITLE>
<BASE href=HTTP://localhost:80>
<META content="MSHTML 6.00.2900.6325" name=GENERATOR>
<SCRIPT id=clientEventHandlersJS type=text/javascript>
//Begin function window_onload
function window_onload() {
UpdateData();
// TODO: Add your event handler code here
}
//End function window_onload
function ValidateForm() {
  var edit1 = document.getElementById("edit1").value;
  alert(edit1);
  if (edit1== "") {
     alert("Please enter the Textbox value");
     return false;
  }
  else {
   return true;
  }
}
</SCRIPT>

<SCRIPT for=window eventname="onload">window.onload = function() { window_onload(); }</SCRIPT>
</HEAD>
<BODY style="OVERFLOW: auto">  
<IFRAME id=iframe1 style="Z-INDEX: 3; LEFT: 190px; WIDTH: 650px; POSITION: absolute; TOP: 310px; HEIGHT: 260px" tabIndex=3 name=iframe1 autoExecute="False"></IFRAME>
<FORM id=form2 style="Z-INDEX: 4; LEFT: 210px; WIDTH: 617px; POSITION: absolute; TOP: 50px; HEIGHT: 214px" tabIndex=4 name=form2 onsubmit="OnExecute(this);return false;" method=post autoExecute="True" default_slider_type="4" form_prompt_location="1" form_number_of_visible_rows="4" form_number_of_columns="4" vert_dist_between_controls="10" form_hor_dist_between_controls="10" form_dist_between_desc_and_input="10" requests_list="0">
<INPUT id=form2Submit style="Z-INDEX: 5; LEFT: 141px; BACKGROUND-IMAGE: url(/ibi_html/javaassist/ibi/html/describe/run16.gif); WIDTH: 38px; BACKGROUND-REPEAT: no-repeat; POSITION: absolute; TOP: 174px; HEIGHT: 22px; BACKGROUND-COLOR: lavender" onclick=ValidateForm(); tabIndex=5 type=submit value=" " name=ITEM1> 
<INPUT id=form2Reset style="Z-INDEX: 6; LEFT: 271px; BACKGROUND-IMAGE: url(/ibi_html/javaassist/ibi/html/describe/reset.gif); WIDTH: 38px; BACKGROUND-REPEAT: no-repeat; POSITION: absolute; TOP: 164px; HEIGHT: 22px; BACKGROUND-COLOR: lavender" tabIndex=6 type=reset value=" " name=reset1> 
<FIELDSET id=form2_formbodyid style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; Z-INDEX: 7; LEFT: 5px; PADDING-BOTTOM: 0px; OVERFLOW: auto; WIDTH: 607px; BORDER-TOP-STYLE: none; PADDING-TOP: 0px; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; POSITION: absolute; TOP: 5px; HEIGHT: 1px; BORDER-BOTTOM-STYLE: none" tabIndex=7 formbody="1"></FIELDSET> 
<INPUT id=edit1 style="Z-INDEX: 8; LEFT: 100px; WIDTH: 260px; POSITION: absolute; TOP: 100px" tabIndex=8 name=edit1></FORM>
<xml id=ibi_requests>
<requests>
<request requestid="0" sourcetype="typeFex" targettype="0" targetname="iframe1" ibif_ex="test.fex" ibic_server="EDASERVE" ibiapp_app="chronos">
<variables/></request></requests>
</xml></BODY></HTML>



Here Validation is works.But the form is submitted.I want to stop submission of form if filter text box is not entered or validated.

In Java script form validation return true means form submission=YES and return false means form submission=NO

Please help me.Thanks in advance.

I am using Dev Studio Version 761.

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 7.6.1
Windows, All Outputs
 
Posts: 50 | Location: Scun-thorpe,UK | Registered: November 14, 2012Report This Post
Gold member
posted Hide Post
Hi Trilochan,
Change the onclick event from

onclick= ValidateForm(); 


to

onclick= "return ValidateForm()"; 


I tried this change, and seems to not submit the form unless a value is entered into the text box. Having the 'Return' before the name prevents the forms submission prematurely. Please see http://www.webreference.com/pr...t/confirm/index.html for more info.

Seyed


WebFOCUS 8.0.09
App Studio 8009
Linux Kernel-2.6
DBMS: Oracle 11g
all output (Excel, HTML, AHTML, PDF)
 
Posts: 90 | Location: Oklahoma City, Oklahoma | Registered: July 01, 2010Report This Post
Gold member
posted Hide Post
Hi SeyedG,

Thanks for your reply.

Then also it is not working after using below code
onclick= "return ValidateForm()";   


I think form is submitted due to below code

 onsubmit="OnExecute(this);return false;" 


Please help me,how to restrict form submission.


WebFOCUS 7.6.1
Windows, All Outputs
 
Posts: 50 | Location: Scun-thorpe,UK | Registered: November 14, 2012Report This Post
Expert
posted Hide Post
[CLOSED] Dev Studio GUI Newbie Question: Where to add form validation?


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Gold member
posted Hide Post
quote:
Originally posted by Trilochan:
Hi SeyedG,

Thanks for your reply.

Then also it is not working after using below code
onclick= "return ValidateForm()";   


I think form is submitted due to below code

 onsubmit="OnExecute(this);return false;" 


Please help me,how to restrict form submission.

Hi Trilochan,
In your onsubmit event handler, you are calling a function called 'OnExecute' that does not exist. You could add something like:
function OnExecute()
 {
  alert('Made it to OnExecute');   
  document.form2.submit(); 
 }


The link Francis suggested contains valuable information that would be helpful to you.

Seyed


WebFOCUS 8.0.09
App Studio 8009
Linux Kernel-2.6
DBMS: Oracle 11g
all output (Excel, HTML, AHTML, PDF)
 
Posts: 90 | Location: Oklahoma City, Oklahoma | Registered: July 01, 2010Report This Post
Gold member
posted Hide Post
Thanks Francis Mariani for your help.

Its works for me.


WebFOCUS 7.6.1
Windows, All Outputs
 
Posts: 50 | Location: Scun-thorpe,UK | Registered: November 14, 2012Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Java Script Form Validation in Webfocus

Copyright © 1996-2020 Information Builders