Solved

How to fill in an entry using a link

Posted on 2011-09-18
8
688 Views
Last Modified: 2012-05-12
I am creating a link from my school webpage to a service webpage. I would like the link to fill in the "siatrict code" box for everyone that clicks on the link.
0
Comment
Question by:ambantin
8 Comments
 
LVL 6

Expert Comment

by:bartvd
ID: 36556349
You could let the link go to for example mypage.html?ref=myschool where mypage.html is the location of your webpage. You could add javascript to your page to check if ref=myschool is in the link. (it is called a get variable) if it is, you can set a code in the box.
On this page: http://scripts.franciscocharrua.com/javascript-get-variables.php is explained how to read a get variable with javascript, you should check for the variable ref.

However, if this code really only needs to be available for everyone in your school this is not very safe, you should use a server side scripting language like php instead.
0
 
LVL 3

Expert Comment

by:dkellner
ID: 36556455
Basically there is nothing you can do ACROSS two different domains; if that service page doesn't belong to you, browsers will probably deny to do the job.

BUT.

If that form is something simple, you can reimplement it (view source, save, and a little editing) so that you'll have a copy of it that posts exactly the same informations for their server.  Now this is YOUR form, sending informations to THEIR server which is okay by default (unless they have some protection), and with your form, of course, you can do whatever you wish, fill in fields, or even change the whole logic.  All that matters is that you send the same POST-data as the original form.

If you have questions about this, give me some details.
0
 
LVL 3

Expert Comment

by:Duboux
ID: 36556602
what's a siatrict code box ?

U mean u want some form-field to be filled in with a value, when u click on a link ?

<a href="#" onclick="document.getElementById('fieldname').value='bla bla'; return false;">link</a>
<input id="fieldname" />

Open in new window

0
 

Author Comment

by:ambantin
ID: 36557241
sorry... district code box is what i meant. Here is a link to the page that I am linking to.

https://www.renweb.com/Logins/ParentsWeb-Login.aspx

 I want the top "District code" box to be filed in with "CC-SDA"
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 3

Expert Comment

by:Duboux
ID: 36557446
Okay, getting it now, I hope XD

I think you want this:

REPLACE:
<input name="DistrictCode" type="text" id="DistrictCode" class="textEntry" />

Open in new window

WITH:
<input name="DistrictCode" type="text" id="DistrictCode" class="textEntry" value="CC-SDA" />

Open in new window

0
 
LVL 3

Accepted Solution

by:
Duboux earned 500 total points
ID: 36557461
OR... and while I was checking, I accidentally noticed that that page already has the following functionality:

https://www.renweb.com/Logins/ParentsWeb-Login.aspx?district=CC-SDA
Works I guess..

because if you make a typo, it shows it filled in:
https://www.renweb.com/Logins/ParentsWeb-Login.aspx?district=CC-SDAWRONG
0
 

Author Comment

by:ambantin
ID: 36557471
ok... still not clear.... I want to put a link on my school web page that will take the person to

https://www.renweb.com/Logins/ParentsWeb-Login.aspx

and "District code" box on the target page needs to be filed in with "CC-SDA"

the renweb (target) page is not mine and I can't change that page.
0
 

Author Closing Comment

by:ambantin
ID: 36557474
perfect...lol... thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now