Appnitro Software Forums » MachForm

Change the 'Submit' button

(12 posts)
  • Started 1 year ago by KnockOuts
  • Latest reply from georgechoi

  1. KnockOuts
    Member

    How do I change the submit button to be a graphic of my own on a particular form?

    Posted 1 year ago #
  2. Hi,

    Check out this post

    http://www.appnitro.com/forums/topic/submit-button-20g#post-2833

    Posted 1 year ago #
  3. KnockOuts
    Member

    What if I need to change it for just a specific form?

    Posted 1 year ago #
  4. You can add a form id condition in there, for example you need to change a submit button for form 6 only, then try to follow these steps :

    1. Go to line 1747 ~ 1751, you'll see these code :

    if(empty($form->review)){
    	$button_text = $lang['submit_button'];
    }else{
    	$button_text = $lang['continue_button'];
    }

    then put these code bellow that line

    if ($_GET['id'] == 6) {
    	$button_code = '<input id="saveForm" class="button_text" type="image"
    src="images/exec.png" name="submit" value="'.$button_text.'" />';
    }
    else {
    	$button_code = '<input id="saveForm" class="button_text" type="submit" name="submit" value="'.$button_text.'" />';
    }

    2. Go to line 1765 and you'll see this code

    <input id="saveForm" class="button_text" type="submit" name="submit" value="{$button_text}" />

    replace the code to be like this

    {$button_code}

    Don't forget to change the form id with yours

    Posted 1 year ago #
  5. georgechoi
    Member

    Hi, I'm not a php coder and I'm trying to have two different forms that will use the same button image as the submit button. I cannot get both forms to use to the same button (one form uses the standard submit button). Why is that?

    For example: if I want to add a custom button for form 6&7, I thought adding codes right after form 6 would work (but it didn't work), and here's what I added as an example:

    if ($_GET['id'] == 7) {
    $button_code = '<input id="saveForm" class="button_text" type="image"
    src="images/exec.png" name="submit" value="'.$button_text.'" />';
    }
    else {
    $button_code = '<input id="saveForm" class="button_text" type="submit" name="submit" value="'.$button_text.'" />';
    }

    Please help!! Thanks in advance.

    Posted 3 months ago #
  6. Simply change the "if" line, to be something like this:

    if (($_GET['id'] == 7) or ($_GET['id'] == 6)) {
    Posted 3 months ago #
  7. georgechoi
    Member

    Thanks yuniar! I will give that a try.

    Posted 3 months ago #
  8. georgechoi
    Member

    Hi yuniar,

    I tried what you told me to do, but it doesn't work yet. I'm not sure I did incorrectly, but everything seems to be correct in the codes. (Please correct me if I'm wrong.)

    This is form 12:
    http://www.webdesigntouch.com/test/webdesigntouch/pricing/index.html

    This is form 13:
    http://www.webdesigntouch.com/test/webdesigntouch/contact/index.html

    I only got form 13 to work, but I would love to get form 12's button to be the same as form 13's.

    Here's my codes:

    if ($_GET['id'] == 12) or ($_GET['id'] == 13)) {
    	$button_code = '<input id="saveForm" class="button_text" type="image"
    src="images/submitBtnForm12.png" name="submit" value="'.$button_text.'" />';
    }
    else {
    	$button_code = '<input id="saveForm" class="button_text" type="submit" name="submit" value="'.$button_text.'" />';
    }
    
    		//markup for submit button
    		$button_markup =<<<EOT
    		<li id="li_buttons" class="buttons">
    			    <input type="hidden" name="form_id" value="{$form->id}" />
    			    {$edit_markup}
    			    <input type="hidden" name="submit" value="1" />
    				{$button_code}
    		</li>

    Thanks in advance again!

    Posted 3 months ago #
  9. I think you missed one opening bracket there.

    Instead of this code:

    if ($_GET['id'] == 12) or ($_GET['id'] == 13)) {

    it should be like this:

    if (($_GET['id'] == 12) or ($_GET['id'] == 13)) {
    Posted 3 months ago #
  10. georgechoi
    Member

    yuniar, I made this change also, but nothing happened. Thanks for the quick reply.

    Posted 3 months ago #
  11. That's weird.
    Can you send me your file please? I'll check it.

    You can mail to: customer.service [at] appnitro.com

    Posted 3 months ago #
  12. georgechoi
    Member

    Hi yuniar, I sent over my view-function.php file through an email from george [at] webdesigntouch.com. Thanks!

    Posted 3 months ago #

RSS feed for this topic

Reply

You must log in to post.