ma201dq
1
Hi Guys,
how can i grab a value off of a URL and fill in a input field on the page with that value? Say I have this url:
http://www.domain.net/bla/bla_bla/?email=%%EMAIL%%&pulse_daily=%%pulsetoday_daily_newsletter%%&
how can i grab the value of var_email and pulse_daily and place it in a input field ?
hello,
with the help of google i got this working, here is the code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript">
function gup( name )
{
name = name.replace(/[\\[]/,"\\\\\\[").replace(/[\\]]/,"\\\\\\]");
var regexS = "[\\\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null )
return "";
else
return results[1];
}
var frank_param = gup( 'fname' );
</script>
</head>
<script type="text/javascript">
document.write(frank_param);
</script>
<body>
</body>
</html>
can sonmeone only show me how i can get document.write(frank_param) into a input field?
please does anyone know how i can get this document.write(frank_param);
into the value of an input field?
thanks
ok I got this also figuerd. If this is useful to anyone her is the code:
<form method="POST" action="something.cgi">
<script type="text/javascript">
document.write(sname_param);
document.write(fname_param);
/*document.getElementById("txtSearch").value = fname_pata;*/
document.write('<input ');
document.write(' type="text" ');
document.write(' name="x_url" ');
document.write(' value="' + sname_param + '">');
</script>
</form>