473,388 Members | 1,975 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

How to prefill a form

I want when visitors go to

http://www.1cellnetindonesia.com/ct_...oko&nama1=test

I want the field memberlain already filled with a name "hardjoko",
that sort of thing. Is there a way to do it?
Jul 23 '05 #1
7 2221
jonathan wrote on 06 jun 2004 in comp.lang.javascript:
I want when visitors go to

http://www.1cellnetindonesia.com/ct_...l#Reg-Temp-Top
?memberlain=hardjoko&nama1=test

I want the field memberlain already filled with a name "hardjoko",
that sort of thing. Is there a way to do it?


Preferably you would do this with serverside code, like ASP(JS/VBS):

<form>
<input name="memberlain" value="<%=Request.querystring("memberlain")%>">
....

=====================================

clientside code is possible:

<script>
function getMemberlain(){
document.getElementById("").value =
document.location.search.replace(/^.*=/,"")
alert(m)
}
</script>
<body onload="getMemberlain()">
<form>
<input name="memberlain" id="memberlain" value="">
......

Not tested

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 23 '05 #2
Evertjan. wrote:
<snip>
http://www.1cellnetindonesia.com/
ct_09DaftarSementara.html#Reg-Temp-Top ^ ?memberlain=hardjoko&nama1=test

<snip>

It may, however, prove valuable for the OP to become familiar with RFC
2396 and the URI syntax it describes, as anything following the fragment
identifier separator - # - is likely to be treated as a fragment
identifier and _not_ as a query string. Making parameters appended to a
fragment identifier as if it was a query unavailable to -
location.search - and probably ASP - Request.querystring -.

Richard.
Jul 23 '05 #3
Richard Cornford wrote on 06 jun 2004 in comp.lang.javascript:
Evertjan. wrote:
<snip>
http://www.1cellnetindonesia.com/
ct_09DaftarSementara.html#Reg-Temp-Top ^ ?memberlain=hardjoko&nama1=test

<snip>

It may, however, prove valuable for the OP to become familiar with RFC
2396 and the URI syntax it describes, as anything following the
fragment identifier separator - # - is likely to be treated as a
fragment identifier and _not_ as a query string. Making parameters
appended to a fragment identifier as if it was a query unavailable to
- location.search - and probably ASP - Request.querystring -.


I do not understand much of what you are saying, but then I am not the
OP.

What fragments do you want to be identified?

Could you explain in beginners language and in simpler English or
perhaps with a translation into Indonesian?

PS:
Just tested the clientside location.search solution.
It had no problems with the
#blah?a=n
string under IE6

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 23 '05 #4
Evertjan. wrote:
Richard Cornford wrote:
Evertjan. wrote:
<snip>
http://www.1cellnetindonesia.com/
ct_09DaftarSementara.html#Reg-Temp-Top ^
?memberlain=hardjoko&nama1=test

<snip>

It may, however, prove valuable for the OP to become familiar with
RFC 2396 and the URI syntax it describes, as anything following the
fragment identifier separator - # - is likely to be treated as a
fragment identifier and _not_ as a query string. Making parameters
appended to a fragment identifier as if it was a query unavailable to
- location.search - and probably ASP - Request.querystring -.


I do not understand much of what you are saying, but then I am not the
OP.

What fragments do you want to be identified?

Could you explain in beginners language and in simpler English ...

<snip>

Err, I don't know if I can explain it satisfactorily, but the URI
grammar rules are:-

<quote cite="RFC 2396 Section 4">
URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]
</quote>

<quote cite="RFC 2396 Section 3">
absoluteURI = scheme ":" ( hier_part | opaque_part )
....
hier_part = ( net_path | abs_path ) [ "?" query ]
net_path = "//" authority [ abs_path ]
abs_path = "/" path_segments
</quote>

<quote cite="RFC 2396 Section 5">
relativeURI = ( net_path | abs_path | rel_path ) [ "?" query ]
</quote>

- and given that grammar, a fragment identifier is an optionl part of a
URI-reference and will appear at the end of such a reference, while the
query string is an optional part of either an absoluteURI or a
relativeURI. As an absoluteURI or a relativeURI must appear in a
URI-reference before a fragment identifier (if they appear at all) then
a query string must precede a fragment identifier if the result is going
to conform to the grammar.
PS:
Just tested the clientside location.search solution.
It had no problems with the
#blah?a=n
string under IE6


Maybe, but relying on the behaviour of the very (perhaps overly)
tolerant IE to be reproduced in all other browsers would not be a my
approach to creating a reliable cross-browser end result.

Richard.
Jul 23 '05 #5
Richard Cornford wrote on 06 jun 2004 in comp.lang.javascript:
Maybe, but relying on the behaviour of the very (perhaps overly)
tolerant IE to be reproduced in all other browsers would not be a my
approach to creating a reliable cross-browser end result.


At least I have never had any problems with ASP's

Request.querystring()

==============

The clientside solution with a location.search.replace() sequence
scould be improved upon,
but even better should be avoided if serverside coding is possible.


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 23 '05 #6
Evertjan. wrote:
Richard Cornford wrote:
Maybe, but relying on the behaviour of the very (perhaps overly)
tolerant IE to be reproduced in all other browsers would not be a
my approach to creating a reliable cross-browser end result.


At least I have never had any problems with ASP's

Request.querystring()

==============

The clientside solution with a location.search.replace() sequence
scould be improved upon,
but even better should be avoided if serverside coding is possible.


Interesting that you don't see constructing URIs to conform with the
specified grammar as the obvious way of avoiding any issue.

Richard.
Jul 23 '05 #7
Richard Cornford wrote on 07 jun 2004 in comp.lang.javascript:
Interesting that you don't see constructing URIs to conform with the
specified grammar as the obvious way of avoiding any issue.


I am pleased that you find me interesting, Richard.

However, You are missing the point of this NG.

They are, among other uses,
for helping people that ask questions about relevant subjects.

I think it would be better if you take up the issue yourself,
as you seem to be very knowledgable about it.

So please advice the OP with your ideas.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 23 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: John | last post by:
Dear all, It been more than 3 days I am trying to debug this program, I interpret it using activePerl and it is giving (perl -wc code_process.pl) no error syntax but when I put it online, change...
5
by: Barry Margolin | last post by:
The online banking site I use has autofill=no set in their login form, and I recently switched from IE to Safari, which honors this. I'd like my account number to be filled in automatically like...
5
by: Richard Cornford | last post by:
I am interested in hearing opinions on the semantic meaning of FORM (elements) in HTML. I have to start of apologising because this question arose in a context that is not applicable to the...
4
by: Targa | last post by:
Trying to total some price fields in a form but doesnt work when all the referenced form fields dont exisit. This is for an invoice - pulled prom a database and the form doesnt always contain the...
7
by: M | last post by:
i have a form which i would like to input different "action" url depending on the button that was clicked. is there a way that javascript can prefill a defined action based on the button...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
19
by: Raposa Velha | last post by:
Hello to all! Does any of you want to comment the approach I implement for instantiating a form? A description and an example follow. Cheers, RV jmclopesAThotmail.com replace the AT with the...
2
by: pbeeke | last post by:
Can you prefill DataGrid footer template fieldswith items from the same datagrid. For example I am using the footer template in the grid in order to add a new record. THe query that updates the...
5
by: SteveShelton | last post by:
I am trying to develop a mileage log for a set of company vehicles. I have created two tables in my testing and set the relationships. I want to have a subform on my mileage log showing the car and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.