", "answerCount": 5, "upvoteCount": 0, "datePublished": "2021-07-15T06:07:06.000Z", "author": { "@type": "Person", "name": "Harshal Khadke", "url": "https://trailblazers.salesforce.com/profileView?u=0053A00000EDtlvQAD", "affiliation": { "@type": "Organization", "name": "InspireXT Consulting Ltd" } }, "acceptedAnswer": { "@type": "Answer", "text": "Hi,   How about this sample?   https://developer.salesforce.com/forums/?id=906F0000000BSFFIA4", "upvoteCount": 0, "url": "https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000C3WRtSAN", "datePublished": "2021-07-15T08:41:36.000Z", "author": { "@type": "Person", "name": "Keiji Otsubo", "url": "https://trailblazers.salesforce.com/profileView?u=0053A00000DGzlUQAT", "affiliation": { "@type": "Organization", "name": "--" } } }, "suggestedAnswer": [ { "@type": "Answer", "text": "Hi Harshal,   I'm glad you solved it.", "upvoteCount": 0, "url": "https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000C3WRtSAN", "datePublished": "2021-07-15T21:29:47.000Z", "author": { "@type": "Person", "name": "Keiji Otsubo", "url": "https://trailblazers.salesforce.com/profileView?u=0053A00000DGzlUQAT", "affiliation": { "@type": "Organization", "name": "--" } } } ] } } Skip to main content

IP Address(Textfield)

I want to set the default value in the IP Address field while the user is filling in details.

this is the code for web to lead form 

<html>

<!-- ---------------------------------------------------------------------- -->

<!-- NOTE: Please add the following <META> element to your page <HEAD>. -->

<!-- If necessary, please modify the charset parameter to specify the -->

<!-- character set of your HTML page. -->

<!-- ---------------------------------------------------------------------- -->

<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8">

<!-- ---------------------------------------------------------------------- -->

<!-- NOTE: Please add the following <FORM> element to your page. -->

<!-- ---------------------------------------------------------------------- -->

<form action="https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST">

<input type=hidden name="oid" value="00D5g0000063ogS">

<input type=hidden name="retURL" value="http://www.google.com">

<!-- ---------------------------------------------------------------------- -->

<!-- NOTE: These fields are optional debugging elements. Please uncomment -->

<!-- these lines if you wish to test in debug mode. -->

<!-- <input type="hidden" name="debug" value=1> -->

<!-- <input type="hidden" name="debugEmail" -->

<!-- value="harshal.khadke@proseraa.com"> -->

<!-- ---------------------------------------------------------------------- -->

<label for="first_name">First Name</label><input id="first_name" maxlength="40" name="first_name" size="20" type="text" /><br>

<label for="last_name">Last Name</label><input id="last_name" maxlength="80" name="last_name" size="20" type="text" /><br>

<label for="email">Email</label><input id="email" maxlength="80" name="email" size="20" type="text" /><br>

<label for="company">Company</label><input id="company" maxlength="40" name="company" size="20" type="text" /><br>

<label for="city">City</label><input id="city" maxlength="40" name="city" size="20" type="text" /><br>

<label for="state">State/Province</label><input id="state" maxlength="20" name="state" size="20" type="text" /><br>

<label for="lead_source">Lead Source</label><select id="lead_source" name="lead_source"><option value="">--None--</option>

<option value="Web" selected>Web</option>

<option value="Phone Inquiry">Phone Inquiry</option>

<option value="Partner Referral">Partner Referral</option>

<option value="Purchased List">Purchased List</option>

<option value="Other">Other</option>

</select><br>

Sub Source:<select id="00N5g00000IO2Lj" name="00N5g00000IO2Lj" title="Sub Source"><option value="">--None--</option>

<option value="Marketing" selected>Marketing</option>

<option value="Channel Partner">Channel Partner</option>

</select><br>

<script src=

"https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js">

</script>

<script>

/* Add "https://api.ipify.org?format=json" statement

this will communicate with the ipify servers in

order to retrieve the IP address $.getJSON will

load JSON-encoded data from the server using a

GET HTTP request */

$.getJSON("https://api.ipify.org?format=json",

function(data) {

// Setting text of element P with id

$("").html(data.ip);

})

</script>

</head>

<input Type="Hidden" id="00N5g00000IOJXR" maxlength="20" name="00N5g00000IOJXR" size="20" type="text" value=""/><br>

<input type="submit" name="submit">

</form>

</html>

#HTML  #Javascript  #Web-to-lead Form  #Web-to-lead  #Service Cloud

5 answers
0/9000