Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to fill in an entry using a link

Posted on 2011-09-18
8
Medium Priority
?
697 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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

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.

Question has a verified solution.

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

Find out what you should include to make the best professional email signature for your organization.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
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…
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…

610 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