Solved

How to fill in an entry using a link

Posted on 2011-09-18
8
690 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

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
 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

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.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

789 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