Jump to content

[SOLVED] Script Help


ainoy31

Recommended Posts

I have an AJAX call that fills in a domain name for me.

 

loadXMLDoc("xxx.php?t="+tradename);
    var docText=xmlhttp.responseText;
    var upsellText= "<strong style='color:#000000'>" + docText + "</strong> or another";
    document.getElementById(urltext).innerHTML = upsellText;

 

Here is the code for the html element that gets filled.  The form name is existingcustomers.

<li style="padding-top:15px"><a href="javascript:link_click('LinkVisit', 76, 'ClickTrack', 3, 
'http://xxx.com/domain_link.php?domain_name='+document.existingcustomers.urltext.value)" > Purchase <span name="urltext" id="urltext">an</span> Internet address for my 
business.</a> This is inexpensive and necessary to prevent other businesses from taking your address. 
</li>

 

The problem is my <a href> tag.  I would like to pass the domain name along to the domain_link page.  But in firefox it tells me it is undefined.  Hope this makes sense.  Much appreciation.  AM

Link to comment
https://forums.phpfreaks.com/topic/165405-solved-script-help/
Share on other sites

Here is my solution.

 

I had to create a hidden element and assign the value to it after the ajax call.

 

document.getElementById('existingcustomers').domainname.value=docText;

 

<form name="existingcustomers" id="existingcustomers" method="post">

<input type="hidden" name="domainname" id="domainname">

</form>

 

Then for my hyperlink, I used this:

 

<a href="javascript:link_click('LinkVisit', <?php print $sessionid ?>, 'ClickTrack', 3,

'http://xxx.com/domain_link.php?dn='+document.getElementById('existingcustomers').domainname.value)" >

 

I was able to pass the generated domain name along to my next page.  Hope this helps someone else out.

Link to comment
https://forums.phpfreaks.com/topic/165405-solved-script-help/#findComment-873116
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.