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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.