General discussion

Locked

How do I autopopulate field from a link?

By drhue ·
My company's IT department uses Blue Ocean's TrackIt! 5.0 to manage its helpdesk. Our company is very focused on customer service and so we wan to use a survey page that our users can fill out when a ticket is closed. We created the survey page but we need the page to have the users ticket number to autopopulate the users ticket number when they click a link sent to them via email. Any idea how to do it?

This conversation is currently closed to new comments.

9 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

How do I autopopulate field from a link?

by nikki96 In reply to How do I autopopulate fie ...

Make the link have a parameter and use script to fill in the value from it.

<a href="myUrl?ticket=1234567">Link text</a>

The page at myUrl has a script, either client-side or server-side, that takes the value of ticket from the url and populates the field with it.

How that is done depends on how the page is made (i.e. is it generated via ASP, ColdFusion, etc or is it a static page), if users' browsers support Javascript, and what browsers need supported.

If you need more info, checkyour server-side script language of choice or client-side javascript for a queryString and how to parse it.

Collapse -

How do I autopopulate field from a link?

by drhue In reply to How do I autopopulate fie ...

I was actually looking for te script i would use. thanks anyway.

Collapse -

How do I autopopulate field from a link?

by Blaine Moore In reply to How do I autopopulate fie ...

Depends on how you generate the page. If it is a straight HTML page, then use javascript:

function getArgs()
{
var args = new Object();
var query = location.search.substring(1);
var pairs = query.split(",");
for(var i=0; i<pairs.length; i++)
{

}
}

Collapse -

How do I autopopulate field from a link?

by Blaine Moore In reply to How do I autopopulate fie ...

Just reject this, I hit enter by accident while I was typing it.

Collapse -

How do I autopopulate field from a link?

by Blaine Moore In reply to How do I autopopulate fie ...

Sorry, didn't finish typing and hit enter. Should read:

function getArgs()
{
var args = new Object();
var query = location.search.substring(1);
var pairs = query.split(",");
for(var i=0; i<pairs.length; i++)
{
var pos = pairs.substring(0,pos);
if(pos == -1) continue;
var argname = pairs.substring(0,pos);
var value = pairs.substring(pos+1);
args[argname] = unescape(value);
}
return args;
}

If you are using ASP, thesyntax is variable=Request.QueryString("VarName") and then just use the variable to autopopulate the input.

Collapse -

by drhue In reply to How do I autopopulate fie ...

Poster rated this answer.

Collapse -

How do I autopopulate field from a link?

by Blaine Moore In reply to How do I autopopulate fie ...

Depends on how you generate the page. If it is a straight HTML page, then use javascript:

function getArgs()
{
var args = new Object();
var query = location.search.substring(1);
var pairs = query.split(",");
for(var i=0; i<pairs.length; i++)
{
var pos = pairs.substring(0,pos);
if(pos == -1) continue;
var argname = pairs.substring(0,pos);
var value = pairs.substring(pos+1);
args[argname] = unescape(value);
}
return args;
}

You can use that function to generate the arguments variable and use that to set the default values.

If you are using ASP, just do:

variable = Request.QueryString("VarName")

and then insert the variable into the VALUE field of the input you want a default for.

The same sort of thing can be done using JSP, PHP, Perl, or whatever other language you are using.

Collapse -

by drhue In reply to How do I autopopulate fie ...

Poster rated this answer.

Collapse -

by drhue In reply to How do I autopopulate fie ...

This question was closed by the author

Back to Web Development Forum
9 total posts (Page 1 of 1)  

Related Discussions

Related Forums