Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Good Day,

Please I am trying execute multiple on click function but I am having problem doing this.

I am a beginner in programming, I'd appreciate if you can help me resolve this problem.

I need help with code sample on how to execute 1stFunction, followed my the 2nd function.

Basically I need to code to validate the Form >> Submit The form to Database >> and Redirect the parent page on clicking of the Iframe submit Button.

Thank you.

What I have tried:

I have showed in my Code

Below is the review of my code:
<button data-uifm-tabnum="0" class="rockfm-txtbox-inp-val btn" type="submit" data-val-btn="Submit" data-val-subm="Sending" onclick="javascript:rocketfm.submitForm(this);return false;" >Submit</button>


Below is a Single Onclick Function that submit form -1st Function;
<pre lang="text">onclick="javascript:rocketfm.submitForm(this);return false;"


Below is the redirect Function I would like to add as the second function -2nd Function:
top.location = 'https://google.com';


How can I achieve this? Help me pls.

Thanks
Posted
Updated 20-Jul-19 6:27am

1 solution

You can call
top.location = 'https://google.com';
after Submitting the form.
JavaScript
<button data-uifm-tabnum="0" class="rockfm-txtbox-inp-val btn" type="submit" data-val-btn="Submit" data-val-subm="Sending" onclick="javascript:rocketfm.submitForm(this);top.location = 'https://google.com';return false;" >Submit</button>

Alternately,
Call top.location = 'https://google.com'; as the last line in your submitForm method.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900