cancel
Showing results for 
Search instead for 
Did you mean: 

Form Scripting for Submit button

sankar_narayana
Active Participant
0 Kudos

Hi,

Has any body worked on Form Scripting in Adobe.

My requirement is, after clicking on Submit, i need to check weather the user has filled the mandatory fields or not.For this Form scripting is necessary i feel.

Can anyone help on this issue.Helpful answer is highly rewarded.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

I'm sure this question is not solved, right?

Well, have you guys tried the "Normal" button to achieve the submit functionality?

sankar_narayana
Active Participant
0 Kudos

Hi.

My issue was not resolved using Webdynpro-Native Submit button.We cannot use Normal Submit button.

Thanks Arafat, for giving info regarding Scripting for Submit button.

But i feel its a complex one becuase here i have used Subform concept. I mean Purchase(Subform)>Data(Subform)>Row1(Subform)-->Comments

Edited by: Sankar Narayana on Jul 22, 2008 3:54 PM

Former Member
0 Kudos

Hi indra,

I'm facing the same problem and i think the only way to solved it is to set a "validation button" in the form as visible and the submit button as hidden .

then in the validation button add your script and if it's ok then set the event of submitbutton , that shoul'd work .

I'll test it and still look for another solution

Best regards

sankar_narayana
Active Participant
0 Kudos

Hey Guys,

My problem is solved as of now. I kept validations at field level and if that misses i kept validation at server side (Webdynpro-Java) level, if that misses and atlast i kept validation at R/3 level. So mostly the user cannot make a mistake crossing these three levels.

I got the same idea what you said i.e hiding the buttons, but here the user should click on the button for two times.

But i still appreciate your suggestion. Thanks for helping.

Now I got another problem. Please check the post today and help me in that issue.

Former Member
0 Kudos

Hi Sankar,

I assume that you are having an Online scenario with a Interactive form UI element in the View. If you want to validate the data filled in the form, you can check the data first and then do the submit action after data is validated. You must have linked an action with the submit action of the IF UI element, In that action before calling the submit functionality you can validate the data that is binded with the context and raise error in case some error is there and these errors can be displayed in the view area.

Let me know if you have something specific.

Regards,

Arafat

sankar_narayana
Active Participant
0 Kudos

Hi Arafat,

I have I want to write the script in the Pre-Submit button. But what validation i need to write.

Let's say i have a comment field which should be filled by the user.And if the comment box is empty i need to raise an alert saying please fill the comments field.

How do i acheive this.

Former Member
0 Kudos

Hi Sankar,

If you want to write script which should be triggerd on pre submit event, you can write it in Javascript or Formcalc like this:

Java Script:

if (Page.Subform.FieldName.rawValue == null)

{

xfa.host.messageBox("Please enter comments in the given box");

xfa.host.setFocus("Page.Subform.FieldName"); // This will return the cursor to the field.

}

Hope this helps!!

Regards,

Arafat

sankar_narayana
Active Participant
0 Kudos

Hi Arafat,

Thanks for respnding quickly.

But when i select the Submit button and selected Pre-Submit option and when i say alert.Iam not getting it.

Then i have taken the Click option and kept alert message it is working.

Any help on this.

Can i know from which city u r from

Former Member
0 Kudos

Pune.

Former Member
0 Kudos

Hi Sankar,

Are you using WDP Native submit button?

preSubmit works fine with WDP Activex or Standard submit button.

Regards,

Arafat

sankar_narayana
Active Participant
0 Kudos

Sorry for the Late reply.

Iam using WDP Native submit button.

Whatever u said was correct, so where do i need to write my code.Please specify.I mean in which function i need to write the code.

Iam from Hyderabad.

Did u work on Adobe Forms.

Edited by: Sankar Narayana on Jun 4, 2008 4:39 PM

Former Member
0 Kudos

>

> Whatever u said was correct, so where do i need to write my code.Please specify.I mean in which function i need to write the code.

Hi Sankar

When you are working with interactive forms inside Web Dynpro, you can check mandatory fields either through Web Dynpro or through Interactive Forms. If you choose to let IF do the work you have to insert your script in the following place:

1. Open your interactive form template (e.g by clicking on <Corresponding-Web-Dynpro-View>Right Click on layout element Interactive Form->"edit" )

2. Select the field in the "Data View" which you wish to be mandatory

3. Go to the Selector "Show: Events with Scripts" in the menu panel and select "Show validate"

4. Insert the valdiation script, e.g. this.isNull || this.rawValue.length >= 0; etc.

You'll find more on scripting in the documents: Adobe_XML_Form_Object_Model_Reference.pdf or lc_designer_scripting_basics.pdf (google will help)

Kind regards

Bettina

Reward points if helpful

sankar_narayana
Active Participant
0 Kudos

Hi,

I got a doubt where do i keep this code

xfa.host.messageBox("Please Enter comments");

Point1:

Is the above code necessary or how do i get the alert message

Point2:

To which field i need to keep the script

this.isNull || this.rawValue.length >= 0;

I have two fields (Comments-TextField & WDPNative Submit Button)

Former Member
0 Kudos

Hi Sankar,

Yes, I am working on Adobe Interactive Forms.

You can place the message on exit event of the comment field and also check it on preSubmit event. Use WDP statndard button with Submit property for it.

Hopefully it would resolve your issue.

Regards,

Arafat

Former Member
0 Kudos

Hi,

Place this code above the code which is used for Submit.

if (field_name.rawValue==null || field_name.rawValue=="")

{

xfa.host.messageBox("alert_message");

}

thanks

Gopal

Former Member
0 Kudos

Hi Arafat, here's the problem.

Well, the message could be showed up, but what should be coded to cancel the Submit action, without showing the default "Submit Cancelled" message box information?

If you can answer this important question, than it's case-closed then!

Thanks!