Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form questions 1

Status
Not open for further replies.

BPMan

Programmer
Jun 25, 2002
163
US
I have two questions that relate to forms:
1. I want to make a text box that is taller than one line. Can this be done?
If so how?Do i have to go to javascript to do it?
2. I want the text box to have an initial value. Can i do this?
Essentially i have a variable and want the text box to contain that value when the page first loads.
Thanks in advance!
 
1. use the <textarea> tag instead.
2.
Code:
<textarea cols=&quot;40&quot; rows=&quot;10&quot; name=&quot;Answer&quot; id=&quot;Answer&quot;>banana</textarea>

have fun!
[monkey] Edward [monkey]

&quot;Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!&quot; -- inventor of the cat door
 
Hi BPMan
This should show you how to set that textarea to an initial variable value:
Code:
<html>
<head>
<Script>
var temp = &quot;hello there&quot;;
function setValue(){
	document.getElementById(&quot;Answer&quot;).value=temp;
}
</script>
</head>
<body onLoad=&quot;setValue()&quot;>
<textarea id=&quot;Answer&quot;>
</textarea>
</body>
</html>
Hope I helped / Thanks for helping
if ((Math.abs(x)<10&&Math.abs(y)<10) &&(((parseIntx.toString()+y.toString())-x-y)%9)!=0)){alert(&quot;I'm a monkey's uncle&quot;);}
 
thanks for the help here is another quick question:
I want to call a php function when i hit submit. Is this possible and why doesn't my code below work?
<form name=&quot;update&quot; method=&quot;post&quot; action=&quot;<?php upFiles() ?>&quot;>
<LABEL for=&quot;cp&quot;><p class=&quot;main2&quot;>Cost Planning</p></LABEL>
<textarea cols=&quot;65&quot; rows=&quot;10&quot; name=&quot;cp&quot; id=&quot;cp&quot;>
<?php echo $cpd ?>
</textarea>
<LABEL for=&quot;ce&quot;><p class=&quot;main2&quot;>Cost Engineering</p></LABEL>
<textarea cols=&quot;65&quot; rows=&quot;10&quot; name=&quot;ce&quot; id=&quot;ce&quot;>
<?php echo $ced ?>
</textarea>
<LABEL for=&quot;news&quot;><p class=&quot;main2&quot;>Latest News:</p></LABEL>
<textarea cols=&quot;65&quot; rows=&quot;8&quot; name=&quot;news&quot; id=&quot;news&quot;>
<?php echo $newd ?>
</textarea>
<p class=&quot;lup2&quot;><INPUT type=&quot;submit&quot; value=&quot;Update&quot;> <INPUT type=&quot;reset&quot;></p>
</form>

thanks
 
I think it is something like this


put a hidden field in your form

<input type=&quot;hidden&quot; name=&quot;cmd&quot; value=&quot;update&quot;>

then use
if($cmd==&quot;update&quot; {
upFiles();
}

if that doesn't work try the php forum
forum434 It's not a lie if you believe it!

| |
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top