Solved

How to fill in an entry using a link

Posted on 2011-09-18
8
694 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

 

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

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.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

688 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