Sibmit button - additional javascript code

Anonymous
Not applicable

Sibmit button - additional javascript code

Hi guys,

If it is possible to change appearance or text on submit button, just overriding , it is possible to change/add new functions on submiting ? I would like to simply add field formatting for lead mobile phone.
I used following syntax:

if (fld.name == 'MobilePhone' ) {

if (fld.value.substr(0,1)== "+") {fld.value=fld.value.replace("+","");}
if (fld.value.substr(0,2)=="00") {fld.value=fld.value.replace("00","");}

 }

(or the same with substr function)

And it seems not working. What else should  I probably change in
/js/mktFormSupport.js

Thank you!

					
				
			
			
				
			
			
				
			
			
			
			
			
			
		
Tags (1)
2 REPLIES 2
Anonymous
Not applicable

Re: Sibmit button - additional javascript code

It is posibul to replace the the submit how you store data.

Here is example on Country to only take 2 letters.

You need to create costum javascript.

US: {
    label: 'US State',
    data: [
    { iso: "", value: "Select" },
    { iso: "AL", value: "Alabama - AL" },
    { iso: "AK", value: "Alaska - AK" },
    { iso: "AR", value: "Arkansas - AR" },  
]
    }
};

$.each(countryData, function(i,v) {
        var inferredCountry = $("#iCountry").text();
        var option = $('<option></option>').val(v.iso).html(v.value);
        if (inferredCountry != "" && v.value.indexOf(inferredCountry.substring(0, 10)) != -1) {
            option.attr('selected', 'selected');
        }

But you need to Defined how you want the submit apeare.



Anonymous
Not applicable

Re: Sibmit button - additional javascript code

Could it be possible to just override js/mktFormSupport.js as it described here: https://community.marketo.com/MarketoArticle?id=kA050000000KzeZCAS
I used the trick previously for text changes. I putted my js function on the standard one, because I don't need to change all submiting process