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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I am currently using this to open a

Status
Not open for further replies.

Deltaflyer

Programmer
Oct 11, 2000
184
GB
I am currently using this to open a brand new window,

<FORM><input type=&quot;button&quot; Value=&quot;WindOpen&quot; ONCLICK=&quot;window.open(MyLink', 'MyTitle, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=xxx,height=yyy')&quot;></FORM>

However i need to do some validation on data entered into the page that, if validated correctly, will eventually open a new window.

Can anybody through some light as to how i can validate my input and open a new window using JavaScript only. DeltaFlyer ;-)

DeltaFlyer - The Only Programmer To Crash With Style.
 
I'm a bit confused as to what you are trying to accomplish. What data are you trying to validate? From the main window where the form is? If so, in the onclick event call a function someFunc:

function someFunc()
{
if(//validation code){window.open(&quot;..&quot;)}
}

a little more explanation and I can help you through this. jared@aauser.com
 
I have :

function checkdate(inDate)
{test = inDate.indexOf(&quot;/&quot;)
if (test == -1)
{return 1}
inDay = inDate.substring(0,test)
if (inDay < 1 || inDay > 31)
{return 1}
temp = inDate.substring(eval(test+1),inDate.length)
test = temp.indexOf(&quot;/&quot;)
if (test == -1)
{return 1}
inMonth = temp.substring(0,test)
if (inMonth < 1 || inMonth > 12)
{return 1}
inYear = temp.substring(eval(test+1),temp.length)
inDate = inMonth + &quot;/&quot; + inDay + &quot;/&quot; + inYear
temp = new Date(inDate)
newDate = temp.toLocaleString()
newDate = newDate.substring(0,newDate.indexOf(&quot; &quot;))
if (newDate == &quot;Invalid&quot;)
output = 1
else
output = 0
return output }


which i need to check several dates with ( it validates that they actually are valid dates ),

Before This I have to validate that the operator is who they say they are and have the relevant access to do what they are trying to do,

After Checking The Dates i want to validate that each of the dates is subsequent, i.e. field1(10-oct-2000) is not before field2(01-jan-1999),

Then i need to validate the entered data matches certain criteria, AND some very specific data entry equations,

Then i need to validate the

The list is VERY nearly endless.

Generally, the page is one whole heap of validation routines, all of these i have working perfectly, i just need to know how to pass all the information i have accumulated into a new window, using JavaScript.

I cannot use HTML because when i try

pagename.url?string='THIS STRING COULD BE 300CHRS LONG'
the information entered does not pass through properly, if at all.

Sorry, Probably not the response you expected,
Hope it helps though Jared.

DeltaFlyer ;-)

DeltaFlyer - The Only Programmer To Crash With Style.
 
once you open the new window, you can access the window that opened it by using the opener property. In other words:

opener.date1.value

will return the value of the date1 field in the window that opened the child window.

does that help? jared@aauser.com
 
Fantastic Jared,

That is totally what i was looking for.
Does it help? NO! it has 100% solved my problem!!!!

DeltaFlyer ;-)

DeltaFlyer - The Only Programmer To Crash With Style.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top