Hi.
I´ve been developing an admin panel with a form where my client will insert data. The point is: I want to avoid him to type pictures' names.
It would be great if he just click in a link beside the proper field that open a new browser window where he choose a picture (easy so far), and when he click on the picture -or the link-, the picture name -for instance, picture01.jpg- is auto pasted in the form field.
Does anybody knows something like that?
Thanks in advance.
2 2542
You can disable the text box, or you can capture key events using, for example, onkeydown, see link.
I've finally found it.
I had to modify a previous javascript taken from a web site.
Here´s the code. Field names were changed after this little test for "picture1" "p..2" "p..etc"
<HEAD>
<script type="text/javascript">
<!-- Begin
function explain( name, output, msg ) {
newwin = window.open( '', '', 'scrollbars=yes,top=80,left=60,width=600,height=60 0' );
if ( !newwin.opener ) newwin.opener = self;
newwin.opener.document.bgColor = "EBEBEB";
with ( newwin.document ) {
open();
write( '<body onLoad="document.form.box.focus()">' );
write( '<form name=form ' );
write( ' onSubmit=opener.document.bgColor="EAE8E4";window.c lose()>' );
write( msg );
write( '<br>' );
write( '<p>Seleccionar una propiedad para el campo ' + name + ' aqui ' );
write( '<left>' );
write( '<?php include "include/conexion.php"; ?>' );
write( '<?php $sql = "SELECT * FROM fotos ORDER BY id DESC"; ?>' );
write( '<?php $result = mysql_query($sql); ?>' );
write( '<?php while ($myrow = mysql_fetch_array($result)) { ?>' );
write( '<p><img src ="prop/big/<?php echo $myrow[image_big]; ?>" width="96" height="69"/> <br /><input type=radio name=box onMouseDown=' + output + '="<?php echo $myrow[image_big]; ?>">' );
write( '<?php echo $myrow[image_title]; ?>' );
write( '<?php } ?></p>' );
write( '<input type=submit value="Enviar">' );
write( '</left></form>' );
write( '<?php include "include/cerrar_conexion.php"; ?>' );
close();
}
}
// End -->
</script>
</HEAD>
<BODY>
<div align="center">
<form name=form>
<span class=PreText>Username:</span>
<input type=text name=username size=10>
<span class=BodyText>[<a href="javascript:explain(
'User Name',
'opener.document.form.username.value',
'<font face=Verdana size=2>' +
'The user name field is where you select a user name that ' +
'you will use every time you access this site.'
);">help</a>]</span>
<br>
<span class=PreText>Password:</span>
<input type=text name=password size=10>
<span class=BodyText>[<a href="javascript:explain(
'Password',
'opener.document.form.password.value',
'<font face=Verdana size=2>' +
'The password field is where you select a unique password ' +
'for your account. This password will be required each ' +
'time you login to the site.'
);">help</a>]</span>
</form>
</div>
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Song Zhang |
last post by:
I need to write asp/script/html code to fill the following function.
1. When a page appA.mycom.com/aa.html (aa.html code shown below) is visited
from my site, a user can click the button "Launch",...
|
by: Display Name |
last post by:
the customer I'm developing a site for uses a canned form-parsing page that
allows her to have an email subscription opt-in page add emails to a list
she can manage using a link that you point your...
|
by: Dave |
last post by:
Hi,
I would like to know if this scenario is possible using Javascript.
Form has input field such as Age, weight etc. If a user does not
put in data in the field, I would like to open...
|
by: Barry Margolin |
last post by:
Can I do the following with Javascript?
My state has a web site that can be used for online filing for
unemployment benefits. Every week I have to go to the site and fill in
a form, checking...
|
by: Moozie |
last post by:
I have a form that people can fill out.
Link looks like:
http://www.myname.com/form.php
A regular form, nothing special.
Now I would like to fill out 1 field automatically by the link I give...
|
by: tshad |
last post by:
MSN has a toolbar that has a Form Fill function that will try to fill form
fields on forms when they come up.
The problem is that it causes problems with some forms and functions.
I found this...
|
by: david |
last post by:
I have created a datagrid with ID dgEncounter in form design, and add a
HyperLink Column, Link, which is bounded to a field URLs that providing the
URL of the page to go for each record. That is...
|
by: Mike Dee |
last post by:
Is it possible to dynamically create a new form object (form1), then create
a new form field object and add it form1, and then add form1 to the current
document? I need to do all this in script...
|
by: Mesuda |
last post by:
Hi.
I´ve been developing an admin panel with a form where my client will insert data. The point is: I want to avoid him to type pictures' names.
It would be great if he just click in a link...
|
by: MichaelK |
last post by:
Hello.
I have all data already collected on the current page?
I want to open another window with the form, fill the fields and submit that
form.
So basically the question is how can I fill all...
|
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,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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,...
| |