homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

Alter Function: Target Textbox instead of Alert
Modify javascript function to target textbox

 4:52 pm on Jun 6, 2003 (gmt 0)

Hi all,

I need to modify this function to send the date value to a textbox within the page instead of to an alert box:

function message(cell)

The HTML form is directly under the calendar object on the same page:

<SCRIPT LANGUAGE="JavaScript">calendar();</SCRIPT>

<!-- TEXT BOX -->
<form method="post" action="report.html">
<input type="text" name="StartDate" id="StartDate" value="01/01/2003" size="8" maxlength=10>

I'm looking for something similar to this, except it targets a textbox within the page:

window.opener.document.getElementById['StartDate'].value = cellday(cell);



 7:50 pm on Jun 6, 2003 (gmt 0)

Like this?

function message(cell)
document.getElementById['StartDate'].value = cellday[cell];


 8:01 pm on Jun 6, 2003 (gmt 0)

Yes, almost like that. I found it on another site. The first set of brackets should be parenthesis, but you are basically right:


Thanks for taking the time.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved