plus the fact that this subject has been answered many times before. You need to perform a search for past posts for an answer before posting questions. I know I was needing this same information over two years ago and found solutions by searching the forums for past posts.
set homePage to "your/url/here"
set jav to "document.form1.login_name.value='your_value';
document.form1.login_pass.value='your_pass';
document.form1.login.click();"
tell application "Safari"
--load your page here
tell document 1
set URL to homePage
--do JavaScript code
do JavaScript jav
end tell
end tell
tell application "Safari"
activate
open location "https://www.your_telephone_code.com"
delay 1
set areaCode to "512"
set phone1 to "555"
set phone2 to "1234"
repeat until ((do JavaScript "document.readyState" in document 1) is "complete")
delay 0.5
end repeat
do JavaScript "document.forms[1].phone1.value = \"" & areaCode & "\"" in document 1
do JavaScript "document.forms[1].phone2.value = \"" & phone1 & "\"" in document 1
do JavaScript "document.forms[1].phone3.value = \"" & phone2 & "\"" in document 1
do JavaScript "document.forms[1].submit()" in document 1
end tell