<html>
<head>
<script type="text/javascript">
function blz()
{
//alert("asdf");
//document.getElementById("link").innerHTML='https://www.facebook.com/dialog/feed?app_id=172099656214641&link='+encodeURI(document.getElementById("product").value)+'&picture=http%3A%2F%2Fsocial.gogmat.com%2Fimages%2Flogo_03.jpg&name='+encodeURI(document.getElementById("subject").value)+'&caption=Invitation%20to%20checkout%20product%20on%20Gogmat&description=Check%20this%20product%20on%20social.gogmat.com%20now.%0A'+encodeURI(document.getElementById("message").value)+'&message=Check%20this%20product%20on%20social.gogmat.com%20now.%0A'+encodeURI(document.getElementById("message").value)+'&redirect_uri='+encodeURI(document.getElementById("redirect").value);
document.getElementById("link").innerHTML=encodeURI("https://www.facebook.com/dialog/feed?app_id=172099656214641&link="+document.getElementById("product").value+"&picture=http%3A%2F%2Fsocial.gogmat.com%2Fimages%2Flogo_03.jpg&name="+document.getElementById("subject").value+"&caption=Invitation%20to%20checkout%20product%20on%20Gogmat&description=Check%20this%20product%20on%20social.gogmat.com%20now.%0A"+document.getElementById("message").value+"&message=Check%20this%20product%20on%20social.gogmat.com%20now.%0A"+document.getElementById("message").value+"&redirect_uri="+document.getElementById("redirect").value);
//document.getElementById('button1').href='https://www.facebook.com/dialog/feed?app_id=172099656214641&link='+encodeURI(document.getElementById("product").value)+'&picture=http%3A%2F%2Fsocial.gogmat.com%2Fimages%2Flogo_03.jpg&name='+encodeURI(document.getElementById("subject").value)+'&caption=Invitation%20to%20checkout%20product%20on%20Gogmat&description=Check%20this%20product%20on%20social.gogmat.com%20now.%0A'+encodeURI(document.getElementById("message").value)+'&message=Check%20this%20product%20on%20social.gogmat.com%20now.%0A'+encodeURI(document.getElementById("message").value)+'&redirect_uri='+encodeURI(document.getElementById("redirect").value);
}
</script>
</head>
<body>
<form action="#">
subject:<input type="text" id="subject" name="subject" value="" onkeyup="return blz()" /><br/>
personal message:<input type="text" id="message" name="message" value="" onkeyup="return blz()" /><br/>
select product for recommend:<input type="text" id="product" name="product" value="" onkeyup="return blz()" /><br/>
link return:<input type="text" id="return" name="return" value="" onkeyup="return blz()" /><br/>
<textarea id="link" name="link" rows="10" cols="40" readonly></textarea><br/>
<a id="button1" href="" target="_blank"><img src="http://social.gogmat.com/components/com_referal/assets/images/bg_send.gif" alt="send button" /></a><br/>
<input type="submit" />
</form>
</body>
</html>
what might be problem in this, am facing the problem with the above code, it is not showing the text inside the textarea or href part of the anchor tag, am in total confusion for the first time about this regard in javascript.
No element with an id of “redirect” is not present in your document. so it’s causing a javascript error.
I have added the missing element with a value of “bleh” to demonstrate.
Another solution would be to remove
document.getElementById("redirect").valuefrom your string.